repo_name
stringlengths
5
122
path
stringlengths
3
232
text
stringlengths
6
1.05M
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/Collector.h
#ifndef Collector_h #define Collector_h #include "swift/Obfuscation/DataStructures.h" #include "swift/Obfuscation/Includer.h" #include "swift/Obfuscation/SymbolGenerator.h" #include <vector> namespace swift { namespace obfuscation { class Collector { private: std::unique_ptr<class Includer> Includer; std::unique_ptr<class SymbolGenerator> SymbolGenerator; public: Collector(std::unique_ptr<class Includer>, std::unique_ptr<class SymbolGenerator>); std::vector<DeclWithSymbolWithRange> collectFrom(DeclWithRange &); std::vector<DeclWithSymbolWithRange> collectFrom(DeclWithRange &&); }; } //namespace obfuscation } //namespace swift #endif /* Collector_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h
<filename>SymbolExtractorAndRenamer/llvm/lib/Target/Mips/MCTargetDesc/MipsELFStreamer.h //===-------- MipsELFStreamer.h - ELF Object Output -----------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This is a custom MCELFStreamer which allows us to insert some hooks before // emitting data into an actual object file. // //===----------------------------------------------------------------------===// #ifndef LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSELFSTREAMER_H #define LLVM_LIB_TARGET_MIPS_MCTARGETDESC_MIPSELFSTREAMER_H #include "MipsOptionRecord.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCELFStreamer.h" #include <memory> namespace llvm { class MCAsmBackend; class MCCodeEmitter; class MCContext; class MCSubtargetInfo; class MipsELFStreamer : public MCELFStreamer { SmallVector<std::unique_ptr<MipsOptionRecord>, 8> MipsOptionRecords; MipsRegInfoRecord *RegInfoRecord; SmallVector<MCSymbol*, 4> Labels; public: MipsELFStreamer(MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter) : MCELFStreamer(Context, MAB, OS, Emitter) { RegInfoRecord = new MipsRegInfoRecord(this, Context); MipsOptionRecords.push_back( std::unique_ptr<MipsRegInfoRecord>(RegInfoRecord)); } /// Overriding this function allows us to add arbitrary behaviour before the /// \p Inst is actually emitted. For example, we can inspect the operands and /// gather sufficient information that allows us to reason about the register /// usage for the translation unit. void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI) override; /// Overriding this function allows us to record all labels that should be /// marked as microMIPS. Based on this data marking is done in /// EmitInstruction. void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()) override; /// Overriding this function allows us to dismiss all labels that are /// candidates for marking as microMIPS when .section directive is processed. void SwitchSection(MCSection *Section, const MCExpr *Subsection = nullptr) override; /// Overriding this function allows us to dismiss all labels that are /// candidates for marking as microMIPS when .word directive is emitted. void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc) override; /// Emits all the option records stored up until the point it's called. void EmitMipsOptionRecords(); /// Mark labels as microMIPS, if necessary for the subtarget. void createPendingLabelRelocs(); }; MCELFStreamer *createMipsELFStreamer(MCContext &Context, MCAsmBackend &MAB, raw_pwrite_stream &OS, MCCodeEmitter *Emitter, bool RelaxAll); } // namespace llvm. #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/Random-Template.h
#ifndef RandomTemplate_h #define RandomTemplate_h #include <sstream> namespace swift { namespace obfuscation { template<typename EngineType, typename DistributionType> RandomIntegerGenerator<EngineType, DistributionType>:: RandomIntegerGenerator(int Min, int Max) : Engine(std::random_device()()), Distribution(Min, Max) { assert(Min <= Max && "The inverted min and max lead to undefined behavior"); } template<typename EngineType, typename DistributionType> int RandomIntegerGenerator<EngineType, DistributionType>::rand() { return Distribution(Engine); } template<typename ElementType, typename GeneratorType> RandomElementChooser<ElementType, GeneratorType>:: RandomElementChooser(const std::vector<ElementType> &ListToChooseFrom) : Generator(0, ListToChooseFrom.empty() ? 0 : ListToChooseFrom.size() - 1), List(ListToChooseFrom) { assert(!ListToChooseFrom.empty() && "list of elements to choose from must " "not be empty"); }; template<typename ElementType, typename GeneratorType> ElementType RandomElementChooser<ElementType, GeneratorType>::rand() { return List.at(Generator.rand()); } template<typename ElementType, typename ChooserType> RandomVectorGenerator<ElementType, ChooserType>:: RandomVectorGenerator(const std::vector<ElementType> &ListToChooseFrom) : Chooser(ListToChooseFrom) {} template<typename ElementType, typename ChooserType> std::vector<ElementType> RandomVectorGenerator<ElementType, ChooserType>:: rand(length_type<ElementType> Length) { std::vector<ElementType> Result; for (length_type<ElementType> i = 0; i < Length; i++) { Result.push_back(Chooser.rand()); } return Result; } template<typename ChooserType> RandomStringGenerator<ChooserType>:: RandomStringGenerator(const std::vector<std::string> &ListToChooseFrom) : Generator(ListToChooseFrom) {} template<typename ChooserType> std::string RandomStringGenerator<ChooserType>::rand(length_type<std::string> Length) { auto Characters = Generator.rand(Length); std::stringstream Result; copyToStream(Characters, std::ostream_iterator<std::string>(Result, "")); return Result.str(); } } } #endif /* RandomTemplate_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Driver/XRay/xray-instrument-cpu.c
<gh_stars>100-1000 // RUN: not %clang -o /dev/null -v -fxray-instrument -c %s // XFAIL: amd64-, x86_64-, x86_64h-, arm, aarch64, arm64 // REQUIRES: linux typedef int a;
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/DataBufferMemoryMap.h
<reponame>Polidea/SiriusObfuscator<filename>SymbolExtractorAndRenamer/lldb/include/lldb/Core/DataBufferMemoryMap.h //===-- DataBufferMemoryMap.h -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_DataBufferMemoryMap_h_ #define liblldb_DataBufferMemoryMap_h_ #include "lldb/Core/DataBuffer.h" #include "lldb/Core/Error.h" #include "lldb/lldb-private.h" #include <string> namespace lldb_private { //---------------------------------------------------------------------- /// @class DataBufferMemoryMap DataBufferMemoryMap.h /// "lldb/Core/DataBufferMemoryMap.h" /// @brief A subclass of DataBuffer that memory maps data. /// /// This class memory maps data and stores any needed data for the /// memory mapping in its internal state. Memory map requests are not /// required to have any alignment or size constraints, this class will /// work around any host OS issues regarding such things. /// /// This class is designed to allow pages to be faulted in as needed and /// works well data from large files that won't be accessed all at once. //---------------------------------------------------------------------- class DataBufferMemoryMap : public DataBuffer { public: //------------------------------------------------------------------ /// Default Constructor //------------------------------------------------------------------ DataBufferMemoryMap(); //------------------------------------------------------------------ /// Destructor. /// /// Virtual destructor since this class inherits from a pure virtual /// base class #DataBuffer. //------------------------------------------------------------------ ~DataBufferMemoryMap() override; //------------------------------------------------------------------ /// Reverts this object to an empty state by unmapping any memory /// that is currently owned. //------------------------------------------------------------------ void Clear(); //------------------------------------------------------------------ /// @copydoc DataBuffer::GetBytes() //------------------------------------------------------------------ uint8_t *GetBytes() override; //------------------------------------------------------------------ /// @copydoc DataBuffer::GetBytes() const //------------------------------------------------------------------ const uint8_t *GetBytes() const override; //------------------------------------------------------------------ /// @copydoc DataBuffer::GetByteSize() const //------------------------------------------------------------------ lldb::offset_t GetByteSize() const override; //------------------------------------------------------------------ /// Error get accessor. /// /// @return /// A const reference to Error object in case memory mapping /// fails. //------------------------------------------------------------------ const Error &GetError() const; //------------------------------------------------------------------ /// Memory map all or part of a file. /// /// Memory map \a length bytes from \a file starting \a offset /// bytes into the file. If \a length is set to \c SIZE_MAX, /// then map as many bytes as possible. /// /// @param[in] file /// The file specification from which to map data. /// /// @param[in] offset /// The offset in bytes from the beginning of the file where /// memory mapping should begin. /// /// @param[in] length /// The size in bytes that should be mapped starting \a offset /// bytes into the file. If \a length is \c SIZE_MAX, map /// as many bytes as possible. Even though it may be possible /// for a 32-bit host debugger to debug a 64-bit target, size_t /// still dictates the maximum possible size that can be mapped /// into this process. For this kind of cross-arch debugging /// scenario, mappings and views should be managed at a higher /// level. /// /// @return /// The number of bytes mapped starting from the \a offset. //------------------------------------------------------------------ size_t MemoryMapFromFileSpec(const FileSpec *file, lldb::offset_t offset = 0, size_t length = SIZE_MAX, bool writeable = false); //------------------------------------------------------------------ /// Memory map all or part of a file. /// /// Memory map \a length bytes from an opened file descriptor \a fd /// starting \a offset bytes into the file. If \a length is set to /// \c SIZE_MAX, then map as many bytes as possible. /// /// @param[in] fd /// The posix file descriptor for an already opened file /// from which to map data. /// /// @param[in] offset /// The offset in bytes from the beginning of the file where /// memory mapping should begin. /// /// @param[in] length /// The size in bytes that should be mapped starting \a offset /// bytes into the file. If \a length is \c SIZE_MAX, map /// as many bytes as possible. /// /// @return /// The number of bytes mapped starting from the \a offset. //------------------------------------------------------------------ size_t MemoryMapFromFileDescriptor(int fd, lldb::offset_t offset, size_t length, bool write, bool fd_is_file); protected: //------------------------------------------------------------------ // Classes that inherit from DataBufferMemoryMap can see and modify these //------------------------------------------------------------------ uint8_t *m_mmap_addr; ///< The actual pointer that was returned from \c mmap() size_t m_mmap_size; ///< The actual number of bytes that were mapped when \c ///mmap() was called uint8_t *m_data; ///< The data the user requested somewhere within the memory ///mapped data. lldb::offset_t m_size; ///< The size of the data the user got when data was requested private: DISALLOW_COPY_AND_ASSIGN(DataBufferMemoryMap); }; } // namespace lldb_private #endif // liblldb_DataBufferMemoryMap_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/CompilerInfrastructure.h
#ifndef CompilerInfrastructure_h #define CompilerInfrastructure_h #include "llvm/Support/Error.h" #include "swift/Frontend/Frontend.h" #include "swift/Obfuscation/DataStructures.h" #include <string> namespace swift { namespace obfuscation { /// Will setup provided CompilerInstance with configuration generated using /// FileJson and MainExecutablePath. If setup succeeds it parses and /// type-checks all files provided during configuration. /// /// In case of failing during instance setup returns Error. /// /// Typical usage: /// \code /// auto CompilerInstanceOrError = /// createCompilerInstance(FilesJson, MainExecutablePath); /// if (auto Error = CompilerInstanceOrError) { /// return std::move(Error); /// } /// auto CompilerInstance = CompilerInstanceOrError.get(); /// \endcode /// /// \param FilesJson - FilesJson structure containing data required /// for compilation. /// /// \param MainExecutablePath - string containing path to main executable used /// during compiler isntance /// /// \returns llvm::Error::success when setup finished correctly or /// error object describing cause of fail. llvm::Expected<std::unique_ptr<CompilerInstance>> createCompilerInstance(const FilesJson &FilesJson, std::string MainExecutablePath, llvm::raw_ostream &LogStream); } //namespace obfuscation } //namespace swift #endif /* CompilerInfrastructure_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/ExpressionParser/Swift/SwiftUserExpression.h
<filename>SymbolExtractorAndRenamer/lldb/source/Plugins/ExpressionParser/Swift/SwiftUserExpression.h //===-- SwiftUserExpression.h -----------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef liblldb_SwiftUserExpression_h_ #define liblldb_SwiftUserExpression_h_ // C Includes // C++ Includes #include <map> #include <string> #include <vector> #include "lldb/Expression/LLVMUserExpression.h" #include "lldb/Expression/Materializer.h" // Other libraries and framework includes // Project includes namespace lldb_private { //---------------------------------------------------------------------- /// @class SwiftUserExpression SwiftUserExpression.h /// "lldb/Expression/SwiftUserExpression.h" /// @brief Encapsulates a single expression for use with Clang /// /// LLDB uses expressions for various purposes, notably to call functions /// and as a backend for the expr command. SwiftUserExpression encapsulates /// the objects needed to parse and interpret or JIT an expression. It /// uses the Clang parser to produce LLVM IR from the expression. //---------------------------------------------------------------------- class SwiftUserExpression : public LLVMUserExpression { public: enum { kDefaultTimeout = 500000u }; enum { eLanguageFlagNeedsObjectPointer = 1 << 0, eLanguageFlagInStaticMethod = 1 << 1, eLanguageFlagIsClass = 1 << 2, eLanguageFlagIsWeakSelf = 1 << 3 }; class SwiftUserExpressionHelper : public ExpressionTypeSystemHelper { public: SwiftUserExpressionHelper(Target &target) : ExpressionTypeSystemHelper(eKindSwiftHelper), m_target(target) {} ~SwiftUserExpressionHelper() {} private: Target &m_target; }; //------------------------------------------------------------------ /// Constructor /// /// @param[in] expr /// The expression to parse. /// /// @param[in] expr_prefix /// If non-NULL, a C string containing translation-unit level /// definitions to be included when the expression is parsed. /// /// @param[in] language /// If not eLanguageTypeUnknown, a language to use when parsing /// the expression. Currently restricted to those languages /// supported by Clang. /// /// @param[in] desired_type /// If not eResultTypeAny, the type to use for the expression /// result. /// /// @param[in] options /// Additional options for the expression. //------------------------------------------------------------------ SwiftUserExpression(ExecutionContextScope &exe_scope, llvm::StringRef expr, llvm::StringRef prefix, lldb::LanguageType language, ResultType desired_type, const EvaluateExpressionOptions &options); //------------------------------------------------------------------ /// Destructor //------------------------------------------------------------------ ~SwiftUserExpression() override; //------------------------------------------------------------------ /// Parse the expression /// /// @param[in] diagnostic_manager /// A diagnostic manager to report parse errors and warnings to. /// /// @param[in] exe_ctx /// The execution context to use when looking up entities that /// are needed for parsing (locations of functions, types of /// variables, persistent variables, etc.) /// /// @param[in] execution_policy /// Determines whether interpretation is possible or mandatory. /// /// @param[in] keep_result_in_memory /// True if the resulting persistent variable should reside in /// target memory, if applicable. /// /// @return /// True on success (no errors); false otherwise. //------------------------------------------------------------------ bool Parse(DiagnosticManager &diagnostic_manager, ExecutionContext &exe_ctx, lldb_private::ExecutionPolicy execution_policy, bool keep_result_in_memory, bool generate_debug_info, uint32_t line_offset = 0) override; ExpressionTypeSystemHelper *GetTypeSystemHelper() override { return &m_type_system_helper; } Materializer::PersistentVariableDelegate &GetResultDelegate() { return m_result_delegate; } Materializer::PersistentVariableDelegate &GetErrorDelegate() { return m_error_delegate; } Materializer::PersistentVariableDelegate &GetPersistentVariableDelegate() { return m_persistent_variable_delegate; } lldb::ExpressionVariableSP GetResultAfterDematerialization(ExecutionContextScope *exe_scope) override; void WillStartExecuting() override; void DidFinishExecuting() override; private: //------------------------------------------------------------------ /// Populate m_in_cplusplus_method and m_in_objectivec_method based on the /// environment. //------------------------------------------------------------------ void ScanContext(ExecutionContext &exe_ctx, lldb_private::Error &err) override; bool AddArguments(ExecutionContext &exe_ctx, std::vector<lldb::addr_t> &args, lldb::addr_t struct_address, DiagnosticManager &diagnostic_manager) override; SwiftUserExpressionHelper m_type_system_helper; class ResultDelegate : public Materializer::PersistentVariableDelegate { public: ResultDelegate(SwiftUserExpression &, bool is_error); ConstString GetName() override; void DidDematerialize(lldb::ExpressionVariableSP &variable) override; void RegisterPersistentState(PersistentExpressionState *persistent_state); lldb::ExpressionVariableSP &GetVariable(); private: SwiftUserExpression &m_user_expression; bool m_is_error; PersistentExpressionState *m_persistent_state; lldb::ExpressionVariableSP m_variable; }; ResultDelegate m_result_delegate; ResultDelegate m_error_delegate; class PersistentVariableDelegate : public Materializer::PersistentVariableDelegate { public: PersistentVariableDelegate(SwiftUserExpression &); ConstString GetName() override; void DidDematerialize(lldb::ExpressionVariableSP &variable) override; private: SwiftUserExpression &m_user_expression; }; PersistentVariableDelegate m_persistent_variable_delegate; }; } // namespace lldb_private #endif // liblldb_SwiftUserExpression_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Modules/Inputs/libc-libcxx/sysroot/usr/include/c++/v1/stddef.h
#ifndef LIBCXX_STDDEF_H #define LIBCXX_STDDEF_H #include <__config> #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Language/Java/JavaLanguage.h
//===-- JavaLanguage.h ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_JavaLanguage_h_ #define liblldb_JavaLanguage_h_ // C Includes // C++ Includes #include <vector> // Other libraries and framework includes #include "llvm/ADT/StringRef.h" // Project includes #include "lldb/Core/ConstString.h" #include "lldb/Target/Language.h" #include "lldb/lldb-private.h" namespace lldb_private { class JavaLanguage : public Language { public: lldb::LanguageType GetLanguageType() const override { return lldb::eLanguageTypeJava; } static void Initialize(); static void Terminate(); static lldb_private::Language *CreateInstance(lldb::LanguageType language); static lldb_private::ConstString GetPluginNameStatic(); ConstString GetPluginName() override; uint32_t GetPluginVersion() override; bool IsNilReference(ValueObject &valobj) override; lldb::TypeCategoryImplSP GetFormatters() override; }; } // namespace lldb_private #endif // liblldb_JavaLanguage_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
//===-- DWARFCompileUnit.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef SymbolFileDWARF_DWARFCompileUnit_h_ #define SymbolFileDWARF_DWARFCompileUnit_h_ #include "DWARFDIE.h" #include "DWARFDebugInfoEntry.h" #include "lldb/lldb-enumerations.h" class NameToDIE; class SymbolFileDWARF; class SymbolFileDWARFDwo; class DWARFCompileUnit { public: enum Producer { eProducerInvalid = 0, eProducerClang, eProducerGCC, eProducerLLVMGCC, eProcucerOther }; DWARFCompileUnit(SymbolFileDWARF *dwarf2Data); ~DWARFCompileUnit(); bool Extract(const lldb_private::DWARFDataExtractor &debug_info, lldb::offset_t *offset_ptr); size_t ExtractDIEsIfNeeded(bool cu_die_only); DWARFDIE LookupAddress(const dw_addr_t address); size_t AppendDIEsWithTag(const dw_tag_t tag, DWARFDIECollection &matching_dies, uint32_t depth = UINT32_MAX) const; void Clear(); bool Verify(lldb_private::Stream *s) const; void Dump(lldb_private::Stream *s) const; dw_offset_t GetOffset() const { return m_offset; } lldb::user_id_t GetID() const; uint32_t Size() const { return m_is_dwarf64 ? 23 : 11; /* Size in bytes of the compile unit header */ } bool ContainsDIEOffset(dw_offset_t die_offset) const { return die_offset >= GetFirstDIEOffset() && die_offset < GetNextCompileUnitOffset(); } dw_offset_t GetFirstDIEOffset() const { return m_offset + Size(); } dw_offset_t GetNextCompileUnitOffset() const { return m_offset + m_length + (m_is_dwarf64 ? 12 : 4); } size_t GetDebugInfoSize() const { return m_length + (m_is_dwarf64 ? 12 : 4) - Size(); /* Size in bytes of the .debug_info data associated with this compile unit. */ } uint32_t GetLength() const { return m_length; } uint16_t GetVersion() const { return m_version; } const DWARFAbbreviationDeclarationSet *GetAbbreviations() const { return m_abbrevs; } dw_offset_t GetAbbrevOffset() const; uint8_t GetAddressByteSize() const { return m_addr_size; } dw_addr_t GetBaseAddress() const { return m_base_addr; } dw_addr_t GetAddrBase() const { return m_addr_base; } dw_addr_t GetRangesBase() const { return m_ranges_base; } void SetAddrBase(dw_addr_t addr_base, dw_addr_t ranges_base, dw_offset_t base_obj_offset); void ClearDIEs(bool keep_compile_unit_die); void BuildAddressRangeTable(SymbolFileDWARF *dwarf2Data, DWARFDebugAranges *debug_aranges); lldb::ByteOrder GetByteOrder() const; lldb_private::TypeSystem *GetTypeSystem(); DWARFFormValue::FixedFormSizes GetFixedFormSizes(); void SetBaseAddress(dw_addr_t base_addr) { m_base_addr = base_addr; } DWARFDIE GetCompileUnitDIEOnly() { return DWARFDIE(this, GetCompileUnitDIEPtrOnly()); } DWARFDIE DIE() { return DWARFDIE(this, DIEPtr()); } void AddDIE(DWARFDebugInfoEntry &die) { // The average bytes per DIE entry has been seen to be // around 14-20 so lets pre-reserve half of that since // we are now stripping the NULL tags. // Only reserve the memory if we are adding children of // the main compile unit DIE. The compile unit DIE is always // the first entry, so if our size is 1, then we are adding // the first compile unit child DIE and should reserve // the memory. if (m_die_array.empty()) m_die_array.reserve(GetDebugInfoSize() / 24); m_die_array.push_back(die); } void AddCompileUnitDIE(DWARFDebugInfoEntry &die); bool HasDIEsParsed() const { return m_die_array.size() > 1; } DWARFDIE GetDIE(dw_offset_t die_offset); static uint8_t GetAddressByteSize(const DWARFCompileUnit *cu); static bool IsDWARF64(const DWARFCompileUnit *cu); static uint8_t GetDefaultAddressSize(); static void SetDefaultAddressSize(uint8_t addr_size); void *GetUserData() const { return m_user_data; } void SetUserData(void *d); bool Supports_DW_AT_APPLE_objc_complete_type(); bool DW_AT_decl_file_attributes_are_invalid(); bool Supports_unnamed_objc_bitfields(); void Index(NameToDIE &func_basenames, NameToDIE &func_fullnames, NameToDIE &func_methods, NameToDIE &func_selectors, NameToDIE &objc_class_selectors, NameToDIE &globals, NameToDIE &types, NameToDIE &namespaces); const DWARFDebugAranges &GetFunctionAranges(); SymbolFileDWARF *GetSymbolFileDWARF() const { return m_dwarf2Data; } Producer GetProducer(); uint32_t GetProducerVersionMajor(); uint32_t GetProducerVersionMinor(); uint32_t GetProducerVersionUpdate(); static lldb::LanguageType LanguageTypeFromDWARF(uint64_t val); lldb::LanguageType GetLanguageType(); bool IsDWARF64() const; bool GetIsOptimized(); SymbolFileDWARFDwo *GetDwoSymbolFile() const { return m_dwo_symbol_file.get(); } dw_offset_t GetBaseObjOffset() const { return m_base_obj_offset; } protected: SymbolFileDWARF *m_dwarf2Data; std::unique_ptr<SymbolFileDWARFDwo> m_dwo_symbol_file; const DWARFAbbreviationDeclarationSet *m_abbrevs; void *m_user_data; DWARFDebugInfoEntry::collection m_die_array; // The compile unit debug information entry item std::unique_ptr<DWARFDebugAranges> m_func_aranges_ap; // A table similar to // the .debug_aranges // table, but this one // points to the exact // DW_TAG_subprogram // DIEs dw_addr_t m_base_addr; dw_offset_t m_offset; dw_offset_t m_length; uint16_t m_version; uint8_t m_addr_size; Producer m_producer; uint32_t m_producer_version_major; uint32_t m_producer_version_minor; uint32_t m_producer_version_update; lldb::LanguageType m_language_type; bool m_is_dwarf64; lldb_private::LazyBool m_is_optimized; dw_addr_t m_addr_base; // Value of DW_AT_addr_base dw_addr_t m_ranges_base; // Value of DW_AT_ranges_base dw_offset_t m_base_obj_offset; // If this is a dwo compile unit this is the // offset of the base compile unit in the main // object file void ParseProducerInfo(); static void IndexPrivate(DWARFCompileUnit *dwarf_cu, const lldb::LanguageType cu_language, const DWARFFormValue::FixedFormSizes &fixed_form_sizes, const dw_offset_t cu_offset, NameToDIE &func_basenames, NameToDIE &func_fullnames, NameToDIE &func_methods, NameToDIE &func_selectors, NameToDIE &objc_class_selectors, NameToDIE &globals, NameToDIE &types, NameToDIE &namespaces); private: const DWARFDebugInfoEntry *GetCompileUnitDIEPtrOnly() { ExtractDIEsIfNeeded(true); if (m_die_array.empty()) return NULL; return &m_die_array[0]; } const DWARFDebugInfoEntry *DIEPtr() { ExtractDIEsIfNeeded(false); if (m_die_array.empty()) return NULL; return &m_die_array[0]; } DISALLOW_COPY_AND_ASSIGN(DWARFCompileUnit); }; #endif // SymbolFileDWARF_DWARFCompileUnit_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/common/NativeWatchpointList.h
//===-- NativeWatchpointList.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_NativeWatchpointList_h_ #define liblldb_NativeWatchpointList_h_ #include "lldb/Core/Error.h" #include "lldb/lldb-private-forward.h" #include <map> namespace lldb_private { struct NativeWatchpoint { lldb::addr_t m_addr; size_t m_size; uint32_t m_watch_flags; bool m_hardware; }; class NativeWatchpointList { public: Error Add(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware); Error Remove(lldb::addr_t addr); using WatchpointMap = std::map<lldb::addr_t, NativeWatchpoint>; const WatchpointMap &GetWatchpointMap() const; private: WatchpointMap m_watchpoints; }; } #endif // ifndef liblldb_NativeWatchpointList_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/llvm/include/llvm/Analysis/LazyBlockFrequencyInfo.h
//===- LazyBlockFrequencyInfo.h - Lazy Block Frequency Analysis -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This is an alternative analysis pass to BlockFrequencyInfoWrapperPass. The // difference is that with this pass the block frequencies are not computed when // the analysis pass is executed but rather when the BFI results is explicitly // requested by the analysis client. // //===----------------------------------------------------------------------===// #ifndef LLVM_ANALYSIS_LAZYBLOCKFREQUENCYINFO_H #define LLVM_ANALYSIS_LAZYBLOCKFREQUENCYINFO_H #include "llvm/Analysis/BlockFrequencyInfo.h" #include "llvm/Analysis/LazyBranchProbabilityInfo.h" #include "llvm/Pass.h" namespace llvm { class AnalysisUsage; class BranchProbabilityInfo; class Function; class LoopInfo; /// Wraps a BFI to allow lazy computation of the block frequencies. /// /// A pass that only conditionally uses BFI can uncondtionally require the /// analysis without paying for the overhead if BFI doesn't end up being used. template <typename FunctionT, typename BranchProbabilityInfoPassT, typename LoopInfoT, typename BlockFrequencyInfoT> class LazyBlockFrequencyInfo { public: LazyBlockFrequencyInfo() : Calculated(false), F(nullptr), BPIPass(nullptr), LI(nullptr) {} /// Set up the per-function input. void setAnalysis(const FunctionT *F, BranchProbabilityInfoPassT *BPIPass, const LoopInfoT *LI) { this->F = F; this->BPIPass = BPIPass; this->LI = LI; } /// Retrieve the BFI with the block frequencies computed. BlockFrequencyInfoT &getCalculated() { if (!Calculated) { assert(F && BPIPass && LI && "call setAnalysis"); BFI.calculate( *F, BPIPassTrait<BranchProbabilityInfoPassT>::getBPI(BPIPass), *LI); Calculated = true; } return BFI; } const BlockFrequencyInfoT &getCalculated() const { return const_cast<LazyBlockFrequencyInfo *>(this)->getCalculated(); } void releaseMemory() { BFI.releaseMemory(); Calculated = false; setAnalysis(nullptr, nullptr, nullptr); } private: BlockFrequencyInfoT BFI; bool Calculated; const FunctionT *F; BranchProbabilityInfoPassT *BPIPass; const LoopInfoT *LI; }; /// \brief This is an alternative analysis pass to /// BlockFrequencyInfoWrapperPass. The difference is that with this pass the /// block frequencies are not computed when the analysis pass is executed but /// rather when the BFI results is explicitly requested by the analysis client. /// /// There are some additional requirements for any client pass that wants to use /// the analysis: /// /// 1. The pass needs to initialize dependent passes with: /// /// INITIALIZE_PASS_DEPENDENCY(LazyBFIPass) /// /// 2. Similarly, getAnalysisUsage should call: /// /// LazyBlockFrequencyInfoPass::getLazyBFIAnalysisUsage(AU) /// /// 3. The computed BFI should be requested with /// getAnalysis<LazyBlockFrequencyInfoPass>().getBFI() before either LoopInfo /// or BPI could be invalidated for example by changing the CFG. /// /// Note that it is expected that we wouldn't need this functionality for the /// new PM since with the new PM, analyses are executed on demand. class LazyBlockFrequencyInfoPass : public FunctionPass { private: LazyBlockFrequencyInfo<Function, LazyBranchProbabilityInfoPass, LoopInfo, BlockFrequencyInfo> LBFI; public: static char ID; LazyBlockFrequencyInfoPass(); /// \brief Compute and return the block frequencies. BlockFrequencyInfo &getBFI() { return LBFI.getCalculated(); } /// \brief Compute and return the block frequencies. const BlockFrequencyInfo &getBFI() const { return LBFI.getCalculated(); } void getAnalysisUsage(AnalysisUsage &AU) const override; /// Helper for client passes to set up the analysis usage on behalf of this /// pass. static void getLazyBFIAnalysisUsage(AnalysisUsage &AU); bool runOnFunction(Function &F) override; void releaseMemory() override; void print(raw_ostream &OS, const Module *M) const override; }; /// \brief Helper for client passes to initialize dependent passes for LBFI. void initializeLazyBFIPassPass(PassRegistry &Registry); } #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/llvm/include/llvm/MC/MCStreamer.h
//===- MCStreamer.h - High-level Streaming Machine Code Output --*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file declares the MCStreamer class. // //===----------------------------------------------------------------------===// #ifndef LLVM_MC_MCSTREAMER_H #define LLVM_MC_MCSTREAMER_H #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include "llvm/MC/MCDirectives.h" #include "llvm/MC/MCDwarf.h" #include "llvm/MC/MCLinkerOptimizationHint.h" #include "llvm/MC/MCSymbol.h" #include "llvm/MC/MCWinEH.h" #include "llvm/Support/DataTypes.h" #include "llvm/Support/SMLoc.h" #include <string> namespace llvm { class MCAsmBackend; class MCCodeEmitter; class MCContext; class MCExpr; class MCInst; class MCInstPrinter; class MCSection; class MCStreamer; class MCSymbolELF; class MCSymbolRefExpr; class MCSubtargetInfo; class StringRef; class Twine; class raw_ostream; class formatted_raw_ostream; class AssemblerConstantPools; typedef std::pair<MCSection *, const MCExpr *> MCSectionSubPair; /// Target specific streamer interface. This is used so that targets can /// implement support for target specific assembly directives. /// /// If target foo wants to use this, it should implement 3 classes: /// * FooTargetStreamer : public MCTargetStreamer /// * FooTargetAsmStreamer : public FooTargetStreamer /// * FooTargetELFStreamer : public FooTargetStreamer /// /// FooTargetStreamer should have a pure virtual method for each directive. For /// example, for a ".bar symbol_name" directive, it should have /// virtual emitBar(const MCSymbol &Symbol) = 0; /// /// The FooTargetAsmStreamer and FooTargetELFStreamer classes implement the /// method. The assembly streamer just prints ".bar symbol_name". The object /// streamer does whatever is needed to implement .bar in the object file. /// /// In the assembly printer and parser the target streamer can be used by /// calling getTargetStreamer and casting it to FooTargetStreamer: /// /// MCTargetStreamer &TS = OutStreamer.getTargetStreamer(); /// FooTargetStreamer &ATS = static_cast<FooTargetStreamer &>(TS); /// /// The base classes FooTargetAsmStreamer and FooTargetELFStreamer should /// *never* be treated differently. Callers should always talk to a /// FooTargetStreamer. class MCTargetStreamer { protected: MCStreamer &Streamer; public: MCTargetStreamer(MCStreamer &S); virtual ~MCTargetStreamer(); MCStreamer &getStreamer() { return Streamer; } // Allow a target to add behavior to the EmitLabel of MCStreamer. virtual void emitLabel(MCSymbol *Symbol); // Allow a target to add behavior to the emitAssignment of MCStreamer. virtual void emitAssignment(MCSymbol *Symbol, const MCExpr *Value); virtual void prettyPrintAsm(MCInstPrinter &InstPrinter, raw_ostream &OS, const MCInst &Inst, const MCSubtargetInfo &STI); virtual void finish(); }; // FIXME: declared here because it is used from // lib/CodeGen/AsmPrinter/ARMException.cpp. class ARMTargetStreamer : public MCTargetStreamer { public: ARMTargetStreamer(MCStreamer &S); ~ARMTargetStreamer() override; virtual void emitFnStart(); virtual void emitFnEnd(); virtual void emitCantUnwind(); virtual void emitPersonality(const MCSymbol *Personality); virtual void emitPersonalityIndex(unsigned Index); virtual void emitHandlerData(); virtual void emitSetFP(unsigned FpReg, unsigned SpReg, int64_t Offset = 0); virtual void emitMovSP(unsigned Reg, int64_t Offset = 0); virtual void emitPad(int64_t Offset); virtual void emitRegSave(const SmallVectorImpl<unsigned> &RegList, bool isVector); virtual void emitUnwindRaw(int64_t StackOffset, const SmallVectorImpl<uint8_t> &Opcodes); virtual void switchVendor(StringRef Vendor); virtual void emitAttribute(unsigned Attribute, unsigned Value); virtual void emitTextAttribute(unsigned Attribute, StringRef String); virtual void emitIntTextAttribute(unsigned Attribute, unsigned IntValue, StringRef StringValue = ""); virtual void emitFPU(unsigned FPU); virtual void emitArch(unsigned Arch); virtual void emitArchExtension(unsigned ArchExt); virtual void emitObjectArch(unsigned Arch); virtual void finishAttributeSection(); virtual void emitInst(uint32_t Inst, char Suffix = '\0'); virtual void AnnotateTLSDescriptorSequence(const MCSymbolRefExpr *SRE); virtual void emitThumbSet(MCSymbol *Symbol, const MCExpr *Value); void finish() override; /// Reset any state between object emissions, i.e. the equivalent of /// MCStreamer's reset method. virtual void reset(); /// Callback used to implement the ldr= pseudo. /// Add a new entry to the constant pool for the current section and return an /// MCExpr that can be used to refer to the constant pool location. const MCExpr *addConstantPoolEntry(const MCExpr *, SMLoc Loc); /// Callback used to implemnt the .ltorg directive. /// Emit contents of constant pool for the current section. void emitCurrentConstantPool(); private: std::unique_ptr<AssemblerConstantPools> ConstantPools; }; /// \brief Streaming machine code generation interface. /// /// This interface is intended to provide a programatic interface that is very /// similar to the level that an assembler .s file provides. It has callbacks /// to emit bytes, handle directives, etc. The implementation of this interface /// retains state to know what the current section is etc. /// /// There are multiple implementations of this interface: one for writing out /// a .s file, and implementations that write out .o files of various formats. /// class MCStreamer { MCContext &Context; std::unique_ptr<MCTargetStreamer> TargetStreamer; MCStreamer(const MCStreamer &) = delete; MCStreamer &operator=(const MCStreamer &) = delete; std::vector<MCDwarfFrameInfo> DwarfFrameInfos; MCDwarfFrameInfo *getCurrentDwarfFrameInfo(); void EnsureValidDwarfFrame(); MCSymbol *EmitCFILabel(); MCSymbol *EmitCFICommon(); std::vector<WinEH::FrameInfo *> WinFrameInfos; WinEH::FrameInfo *CurrentWinFrameInfo; void EnsureValidWinFrameInfo(); /// \brief Tracks an index to represent the order a symbol was emitted in. /// Zero means we did not emit that symbol. DenseMap<const MCSymbol *, unsigned> SymbolOrdering; /// \brief This is stack of current and previous section values saved by /// PushSection. SmallVector<std::pair<MCSectionSubPair, MCSectionSubPair>, 4> SectionStack; /// The next unique ID to use when creating a WinCFI-related section (.pdata /// or .xdata). This ID ensures that we have a one-to-one mapping from /// code section to unwind info section, which MSVC's incremental linker /// requires. unsigned NextWinCFIID = 0; protected: MCStreamer(MCContext &Ctx); virtual void EmitCFIStartProcImpl(MCDwarfFrameInfo &Frame); virtual void EmitCFIEndProcImpl(MCDwarfFrameInfo &CurFrame); WinEH::FrameInfo *getCurrentWinFrameInfo() { return CurrentWinFrameInfo; } virtual void EmitWindowsUnwindTables(); virtual void EmitRawTextImpl(StringRef String); public: virtual ~MCStreamer(); void visitUsedExpr(const MCExpr &Expr); virtual void visitUsedSymbol(const MCSymbol &Sym); void setTargetStreamer(MCTargetStreamer *TS) { TargetStreamer.reset(TS); } /// State management /// virtual void reset(); MCContext &getContext() const { return Context; } MCTargetStreamer *getTargetStreamer() { return TargetStreamer.get(); } unsigned getNumFrameInfos() { return DwarfFrameInfos.size(); } ArrayRef<MCDwarfFrameInfo> getDwarfFrameInfos() const { return DwarfFrameInfos; } bool hasUnfinishedDwarfFrameInfo(); unsigned getNumWinFrameInfos() { return WinFrameInfos.size(); } ArrayRef<WinEH::FrameInfo *> getWinFrameInfos() const { return WinFrameInfos; } void generateCompactUnwindEncodings(MCAsmBackend *MAB); /// \name Assembly File Formatting. /// @{ /// \brief Return true if this streamer supports verbose assembly and if it is /// enabled. virtual bool isVerboseAsm() const { return false; } /// \brief Return true if this asm streamer supports emitting unformatted text /// to the .s file with EmitRawText. virtual bool hasRawTextSupport() const { return false; } /// \brief Is the integrated assembler required for this streamer to function /// correctly? virtual bool isIntegratedAssemblerRequired() const { return false; } /// \brief Add a textual comment. /// /// Typically for comments that can be emitted to the generated .s /// file if applicable as a QoI issue to make the output of the compiler /// more readable. This only affects the MCAsmStreamer, and only when /// verbose assembly output is enabled. /// /// If the comment includes embedded \n's, they will each get the comment /// prefix as appropriate. The added comment should not end with a \n. /// By default, each comment is terminated with an end of line, i.e. the /// EOL param is set to true by default. If one prefers not to end the /// comment with a new line then the EOL param should be passed /// with a false value. virtual void AddComment(const Twine &T, bool EOL = true) {} /// \brief Return a raw_ostream that comments can be written to. Unlike /// AddComment, you are required to terminate comments with \n if you use this /// method. virtual raw_ostream &GetCommentOS(); /// \brief Print T and prefix it with the comment string (normally #) and /// optionally a tab. This prints the comment immediately, not at the end of /// the current line. It is basically a safe version of EmitRawText: since it /// only prints comments, the object streamer ignores it instead of asserting. virtual void emitRawComment(const Twine &T, bool TabPrefix = true); /// \brief Add explicit comment T. T is required to be a valid /// comment in the output and does not need to be escaped. virtual void addExplicitComment(const Twine &T); /// \brief Emit added explicit comments. virtual void emitExplicitComments(); /// AddBlankLine - Emit a blank line to a .s file to pretty it up. virtual void AddBlankLine() {} /// @} /// \name Symbol & Section Management /// @{ /// \brief Return the current section that the streamer is emitting code to. MCSectionSubPair getCurrentSection() const { if (!SectionStack.empty()) return SectionStack.back().first; return MCSectionSubPair(); } MCSection *getCurrentSectionOnly() const { return getCurrentSection().first; } /// \brief Return the previous section that the streamer is emitting code to. MCSectionSubPair getPreviousSection() const { if (!SectionStack.empty()) return SectionStack.back().second; return MCSectionSubPair(); } /// \brief Returns an index to represent the order a symbol was emitted in. /// (zero if we did not emit that symbol) unsigned GetSymbolOrder(const MCSymbol *Sym) const { return SymbolOrdering.lookup(Sym); } /// \brief Update streamer for a new active section. /// /// This is called by PopSection and SwitchSection, if the current /// section changes. virtual void ChangeSection(MCSection *, const MCExpr *); /// \brief Save the current and previous section on the section stack. void PushSection() { SectionStack.push_back( std::make_pair(getCurrentSection(), getPreviousSection())); } /// \brief Restore the current and previous section from the section stack. /// Calls ChangeSection as needed. /// /// Returns false if the stack was empty. bool PopSection() { if (SectionStack.size() <= 1) return false; auto I = SectionStack.end(); --I; MCSectionSubPair OldSection = I->first; --I; MCSectionSubPair NewSection = I->first; if (OldSection != NewSection) ChangeSection(NewSection.first, NewSection.second); SectionStack.pop_back(); return true; } bool SubSection(const MCExpr *Subsection) { if (SectionStack.empty()) return false; SwitchSection(SectionStack.back().first.first, Subsection); return true; } /// Set the current section where code is being emitted to \p Section. This /// is required to update CurSection. /// /// This corresponds to assembler directives like .section, .text, etc. virtual void SwitchSection(MCSection *Section, const MCExpr *Subsection = nullptr); /// \brief Set the current section where code is being emitted to \p Section. /// This is required to update CurSection. This version does not call /// ChangeSection. void SwitchSectionNoChange(MCSection *Section, const MCExpr *Subsection = nullptr) { assert(Section && "Cannot switch to a null section!"); MCSectionSubPair curSection = SectionStack.back().first; SectionStack.back().second = curSection; if (MCSectionSubPair(Section, Subsection) != curSection) SectionStack.back().first = MCSectionSubPair(Section, Subsection); } /// \brief Create the default sections and set the initial one. virtual void InitSections(bool NoExecStack); MCSymbol *endSection(MCSection *Section); /// \brief Sets the symbol's section. /// /// Each emitted symbol will be tracked in the ordering table, /// so we can sort on them later. void AssignFragment(MCSymbol *Symbol, MCFragment *Fragment); /// \brief Emit a label for \p Symbol into the current section. /// /// This corresponds to an assembler statement such as: /// foo: /// /// \param Symbol - The symbol to emit. A given symbol should only be /// emitted as a label once, and symbols emitted as a label should never be /// used in an assignment. // FIXME: These emission are non-const because we mutate the symbol to // add the section we're emitting it to later. virtual void EmitLabel(MCSymbol *Symbol, SMLoc Loc = SMLoc()); virtual void EmitEHSymAttributes(const MCSymbol *Symbol, MCSymbol *EHSymbol); /// \brief Note in the output the specified \p Flag. virtual void EmitAssemblerFlag(MCAssemblerFlag Flag); /// \brief Emit the given list \p Options of strings as linker /// options into the output. virtual void EmitLinkerOptions(ArrayRef<std::string> Kind) {} /// \brief Note in the output the specified region \p Kind. virtual void EmitDataRegion(MCDataRegionType Kind) {} /// \brief Specify the MachO minimum deployment target version. virtual void EmitVersionMin(MCVersionMinType, unsigned Major, unsigned Minor, unsigned Update) {} /// \brief Note in the output that the specified \p Func is a Thumb mode /// function (ARM target only). virtual void EmitThumbFunc(MCSymbol *Func); /// \brief Emit an assignment of \p Value to \p Symbol. /// /// This corresponds to an assembler statement such as: /// symbol = value /// /// The assignment generates no code, but has the side effect of binding the /// value in the current context. For the assembly streamer, this prints the /// binding into the .s file. /// /// \param Symbol - The symbol being assigned to. /// \param Value - The value for the symbol. virtual void EmitAssignment(MCSymbol *Symbol, const MCExpr *Value); /// \brief Emit an weak reference from \p Alias to \p Symbol. /// /// This corresponds to an assembler statement such as: /// .weakref alias, symbol /// /// \param Alias - The alias that is being created. /// \param Symbol - The symbol being aliased. virtual void EmitWeakReference(MCSymbol *Alias, const MCSymbol *Symbol); /// \brief Add the given \p Attribute to \p Symbol. virtual bool EmitSymbolAttribute(MCSymbol *Symbol, MCSymbolAttr Attribute) = 0; /// \brief Set the \p DescValue for the \p Symbol. /// /// \param Symbol - The symbol to have its n_desc field set. /// \param DescValue - The value to set into the n_desc field. virtual void EmitSymbolDesc(MCSymbol *Symbol, unsigned DescValue); /// \brief Start emitting COFF symbol definition /// /// \param Symbol - The symbol to have its External & Type fields set. virtual void BeginCOFFSymbolDef(const MCSymbol *Symbol); /// \brief Emit the storage class of the symbol. /// /// \param StorageClass - The storage class the symbol should have. virtual void EmitCOFFSymbolStorageClass(int StorageClass); /// \brief Emit the type of the symbol. /// /// \param Type - A COFF type identifier (see COFF::SymbolType in X86COFF.h) virtual void EmitCOFFSymbolType(int Type); /// \brief Marks the end of the symbol definition. virtual void EndCOFFSymbolDef(); virtual void EmitCOFFSafeSEH(MCSymbol const *Symbol); /// \brief Emits a COFF section index. /// /// \param Symbol - Symbol the section number relocation should point to. virtual void EmitCOFFSectionIndex(MCSymbol const *Symbol); /// \brief Emits a COFF section relative relocation. /// /// \param Symbol - Symbol the section relative relocation should point to. virtual void EmitCOFFSecRel32(MCSymbol const *Symbol, uint64_t Offset); /// \brief Emit an ELF .size directive. /// /// This corresponds to an assembler statement such as: /// .size symbol, expression virtual void emitELFSize(MCSymbol *Symbol, const MCExpr *Value); /// \brief Emit a Linker Optimization Hint (LOH) directive. /// \param Args - Arguments of the LOH. virtual void EmitLOHDirective(MCLOHType Kind, const MCLOHArgs &Args) {} /// \brief Emit a common symbol. /// /// \param Symbol - The common symbol to emit. /// \param Size - The size of the common symbol. /// \param ByteAlignment - The alignment of the symbol if /// non-zero. This must be a power of 2. virtual void EmitCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment) = 0; /// \brief Emit a local common (.lcomm) symbol. /// /// \param Symbol - The common symbol to emit. /// \param Size - The size of the common symbol. /// \param ByteAlignment - The alignment of the common symbol in bytes. virtual void EmitLocalCommonSymbol(MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment); /// \brief Emit the zerofill section and an optional symbol. /// /// \param Section - The zerofill section to create and or to put the symbol /// \param Symbol - The zerofill symbol to emit, if non-NULL. /// \param Size - The size of the zerofill symbol. /// \param ByteAlignment - The alignment of the zerofill symbol if /// non-zero. This must be a power of 2 on some targets. virtual void EmitZerofill(MCSection *Section, MCSymbol *Symbol = nullptr, uint64_t Size = 0, unsigned ByteAlignment = 0) = 0; /// \brief Emit a thread local bss (.tbss) symbol. /// /// \param Section - The thread local common section. /// \param Symbol - The thread local common symbol to emit. /// \param Size - The size of the symbol. /// \param ByteAlignment - The alignment of the thread local common symbol /// if non-zero. This must be a power of 2 on some targets. virtual void EmitTBSSSymbol(MCSection *Section, MCSymbol *Symbol, uint64_t Size, unsigned ByteAlignment = 0); /// @} /// \name Generating Data /// @{ /// \brief Emit the bytes in \p Data into the output. /// /// This is used to implement assembler directives such as .byte, .ascii, /// etc. virtual void EmitBytes(StringRef Data); /// Functionally identical to EmitBytes. When emitting textual assembly, this /// method uses .byte directives instead of .ascii or .asciz for readability. virtual void EmitBinaryData(StringRef Data); /// \brief Emit the expression \p Value into the output as a native /// integer of the given \p Size bytes. /// /// This is used to implement assembler directives such as .word, .quad, /// etc. /// /// \param Value - The value to emit. /// \param Size - The size of the integer (in bytes) to emit. This must /// match a native machine width. /// \param Loc - The location of the expression for error reporting. virtual void EmitValueImpl(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc()); void EmitValue(const MCExpr *Value, unsigned Size, SMLoc Loc = SMLoc()); /// \brief Special case of EmitValue that avoids the client having /// to pass in a MCExpr for constant integers. virtual void EmitIntValue(uint64_t Value, unsigned Size); virtual void EmitULEB128Value(const MCExpr *Value); virtual void EmitSLEB128Value(const MCExpr *Value); /// \brief Special case of EmitULEB128Value that avoids the client having to /// pass in a MCExpr for constant integers. void EmitULEB128IntValue(uint64_t Value, unsigned Padding = 0); /// \brief Special case of EmitSLEB128Value that avoids the client having to /// pass in a MCExpr for constant integers. void EmitSLEB128IntValue(int64_t Value); /// \brief Special case of EmitValue that avoids the client having to pass in /// a MCExpr for MCSymbols. void EmitSymbolValue(const MCSymbol *Sym, unsigned Size, bool IsSectionRelative = false); /// \brief Emit the expression \p Value into the output as a dtprel /// (64-bit DTP relative) value. /// /// This is used to implement assembler directives such as .dtpreldword on /// targets that support them. virtual void EmitDTPRel64Value(const MCExpr *Value); /// \brief Emit the expression \p Value into the output as a dtprel /// (32-bit DTP relative) value. /// /// This is used to implement assembler directives such as .dtprelword on /// targets that support them. virtual void EmitDTPRel32Value(const MCExpr *Value); /// \brief Emit the expression \p Value into the output as a tprel /// (64-bit TP relative) value. /// /// This is used to implement assembler directives such as .tpreldword on /// targets that support them. virtual void EmitTPRel64Value(const MCExpr *Value); /// \brief Emit the expression \p Value into the output as a tprel /// (32-bit TP relative) value. /// /// This is used to implement assembler directives such as .tprelword on /// targets that support them. virtual void EmitTPRel32Value(const MCExpr *Value); /// \brief Emit the expression \p Value into the output as a gprel64 (64-bit /// GP relative) value. /// /// This is used to implement assembler directives such as .gpdword on /// targets that support them. virtual void EmitGPRel64Value(const MCExpr *Value); /// \brief Emit the expression \p Value into the output as a gprel32 (32-bit /// GP relative) value. /// /// This is used to implement assembler directives such as .gprel32 on /// targets that support them. virtual void EmitGPRel32Value(const MCExpr *Value); /// \brief Emit NumBytes bytes worth of the value specified by FillValue. /// This implements directives such as '.space'. virtual void emitFill(uint64_t NumBytes, uint8_t FillValue); /// \brief Emit \p Size bytes worth of the value specified by \p FillValue. /// /// This is used to implement assembler directives such as .space or .skip. /// /// \param NumBytes - The number of bytes to emit. /// \param FillValue - The value to use when filling bytes. /// \param Loc - The location of the expression for error reporting. virtual void emitFill(const MCExpr &NumBytes, uint64_t FillValue, SMLoc Loc = SMLoc()); /// \brief Emit \p NumValues copies of \p Size bytes. Each \p Size bytes is /// taken from the lowest order 4 bytes of \p Expr expression. /// /// This is used to implement assembler directives such as .fill. /// /// \param NumValues - The number of copies of \p Size bytes to emit. /// \param Size - The size (in bytes) of each repeated value. /// \param Expr - The expression from which \p Size bytes are used. virtual void emitFill(uint64_t NumValues, int64_t Size, int64_t Expr); virtual void emitFill(const MCExpr &NumValues, int64_t Size, int64_t Expr, SMLoc Loc = SMLoc()); /// \brief Emit NumBytes worth of zeros. /// This function properly handles data in virtual sections. void EmitZeros(uint64_t NumBytes); /// \brief Emit some number of copies of \p Value until the byte alignment \p /// ByteAlignment is reached. /// /// If the number of bytes need to emit for the alignment is not a multiple /// of \p ValueSize, then the contents of the emitted fill bytes is /// undefined. /// /// This used to implement the .align assembler directive. /// /// \param ByteAlignment - The alignment to reach. This must be a power of /// two on some targets. /// \param Value - The value to use when filling bytes. /// \param ValueSize - The size of the integer (in bytes) to emit for /// \p Value. This must match a native machine width. /// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If /// the alignment cannot be reached in this many bytes, no bytes are /// emitted. virtual void EmitValueToAlignment(unsigned ByteAlignment, int64_t Value = 0, unsigned ValueSize = 1, unsigned MaxBytesToEmit = 0); /// \brief Emit nops until the byte alignment \p ByteAlignment is reached. /// /// This used to align code where the alignment bytes may be executed. This /// can emit different bytes for different sizes to optimize execution. /// /// \param ByteAlignment - The alignment to reach. This must be a power of /// two on some targets. /// \param MaxBytesToEmit - The maximum numbers of bytes to emit, or 0. If /// the alignment cannot be reached in this many bytes, no bytes are /// emitted. virtual void EmitCodeAlignment(unsigned ByteAlignment, unsigned MaxBytesToEmit = 0); /// \brief Emit some number of copies of \p Value until the byte offset \p /// Offset is reached. /// /// This is used to implement assembler directives such as .org. /// /// \param Offset - The offset to reach. This may be an expression, but the /// expression must be associated with the current section. /// \param Value - The value to use when filling bytes. virtual void emitValueToOffset(const MCExpr *Offset, unsigned char Value, SMLoc Loc); /// @} /// \brief Switch to a new logical file. This is used to implement the '.file /// "foo.c"' assembler directive. virtual void EmitFileDirective(StringRef Filename); /// \brief Emit the "identifiers" directive. This implements the /// '.ident "version foo"' assembler directive. virtual void EmitIdent(StringRef IdentString) {} /// \brief Associate a filename with a specified logical file number. This /// implements the DWARF2 '.file 4 "foo.c"' assembler directive. virtual unsigned EmitDwarfFileDirective(unsigned FileNo, StringRef Directory, StringRef Filename, unsigned CUID = 0); /// \brief This implements the DWARF2 '.loc fileno lineno ...' assembler /// directive. virtual void EmitDwarfLocDirective(unsigned FileNo, unsigned Line, unsigned Column, unsigned Flags, unsigned Isa, unsigned Discriminator, StringRef FileName); /// \brief Associate a filename with a specified logical file number. This /// implements the '.cv_file 4 "foo.c"' assembler directive. Returns true on /// success. virtual bool EmitCVFileDirective(unsigned FileNo, StringRef Filename); /// \brief Introduces a function id for use with .cv_loc. virtual bool EmitCVFuncIdDirective(unsigned FunctionId); /// \brief Introduces an inline call site id for use with .cv_loc. Includes /// extra information for inline line table generation. virtual bool EmitCVInlineSiteIdDirective(unsigned FunctionId, unsigned IAFunc, unsigned IAFile, unsigned IALine, unsigned IACol, SMLoc Loc); /// \brief This implements the CodeView '.cv_loc' assembler directive. virtual void EmitCVLocDirective(unsigned FunctionId, unsigned FileNo, unsigned Line, unsigned Column, bool PrologueEnd, bool IsStmt, StringRef FileName, SMLoc Loc); /// \brief This implements the CodeView '.cv_linetable' assembler directive. virtual void EmitCVLinetableDirective(unsigned FunctionId, const MCSymbol *FnStart, const MCSymbol *FnEnd); /// \brief This implements the CodeView '.cv_inline_linetable' assembler /// directive. virtual void EmitCVInlineLinetableDirective(unsigned PrimaryFunctionId, unsigned SourceFileId, unsigned SourceLineNum, const MCSymbol *FnStartSym, const MCSymbol *FnEndSym); /// \brief This implements the CodeView '.cv_def_range' assembler /// directive. virtual void EmitCVDefRangeDirective( ArrayRef<std::pair<const MCSymbol *, const MCSymbol *>> Ranges, StringRef FixedSizePortion); /// \brief This implements the CodeView '.cv_stringtable' assembler directive. virtual void EmitCVStringTableDirective() {} /// \brief This implements the CodeView '.cv_filechecksums' assembler directive. virtual void EmitCVFileChecksumsDirective() {} /// Emit the absolute difference between two symbols. /// /// \pre Offset of \c Hi is greater than the offset \c Lo. virtual void emitAbsoluteSymbolDiff(const MCSymbol *Hi, const MCSymbol *Lo, unsigned Size); virtual MCSymbol *getDwarfLineTableSymbol(unsigned CUID); virtual void EmitCFISections(bool EH, bool Debug); void EmitCFIStartProc(bool IsSimple); void EmitCFIEndProc(); virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset); virtual void EmitCFIDefCfaOffset(int64_t Offset); virtual void EmitCFIDefCfaRegister(int64_t Register); virtual void EmitCFIOffset(int64_t Register, int64_t Offset); virtual void EmitCFIPersonality(const MCSymbol *Sym, unsigned Encoding); virtual void EmitCFILsda(const MCSymbol *Sym, unsigned Encoding); virtual void EmitCFIRememberState(); virtual void EmitCFIRestoreState(); virtual void EmitCFISameValue(int64_t Register); virtual void EmitCFIRestore(int64_t Register); virtual void EmitCFIRelOffset(int64_t Register, int64_t Offset); virtual void EmitCFIAdjustCfaOffset(int64_t Adjustment); virtual void EmitCFIEscape(StringRef Values); virtual void EmitCFIGnuArgsSize(int64_t Size); virtual void EmitCFISignalFrame(); virtual void EmitCFIUndefined(int64_t Register); virtual void EmitCFIRegister(int64_t Register1, int64_t Register2); virtual void EmitCFIWindowSave(); virtual void EmitWinCFIStartProc(const MCSymbol *Symbol); virtual void EmitWinCFIEndProc(); virtual void EmitWinCFIStartChained(); virtual void EmitWinCFIEndChained(); virtual void EmitWinCFIPushReg(unsigned Register); virtual void EmitWinCFISetFrame(unsigned Register, unsigned Offset); virtual void EmitWinCFIAllocStack(unsigned Size); virtual void EmitWinCFISaveReg(unsigned Register, unsigned Offset); virtual void EmitWinCFISaveXMM(unsigned Register, unsigned Offset); virtual void EmitWinCFIPushFrame(bool Code); virtual void EmitWinCFIEndProlog(); virtual void EmitWinEHHandler(const MCSymbol *Sym, bool Unwind, bool Except); virtual void EmitWinEHHandlerData(); /// Get the .pdata section used for the given section. Typically the given /// section is either the main .text section or some other COMDAT .text /// section, but it may be any section containing code. MCSection *getAssociatedPDataSection(const MCSection *TextSec); /// Get the .xdata section used for the given section. MCSection *getAssociatedXDataSection(const MCSection *TextSec); virtual void EmitSyntaxDirective(); /// \brief Emit a .reloc directive. /// Returns true if the relocation could not be emitted because Name is not /// known. virtual bool EmitRelocDirective(const MCExpr &Offset, StringRef Name, const MCExpr *Expr, SMLoc Loc) { return true; } /// \brief Emit the given \p Instruction into the current section. virtual void EmitInstruction(const MCInst &Inst, const MCSubtargetInfo &STI); /// \brief Set the bundle alignment mode from now on in the section. /// The argument is the power of 2 to which the alignment is set. The /// value 0 means turn the bundle alignment off. virtual void EmitBundleAlignMode(unsigned AlignPow2); /// \brief The following instructions are a bundle-locked group. /// /// \param AlignToEnd - If true, the bundle-locked group will be aligned to /// the end of a bundle. virtual void EmitBundleLock(bool AlignToEnd); /// \brief Ends a bundle-locked group. virtual void EmitBundleUnlock(); /// \brief If this file is backed by a assembly streamer, this dumps the /// specified string in the output .s file. This capability is indicated by /// the hasRawTextSupport() predicate. By default this aborts. void EmitRawText(const Twine &String); /// \brief Streamer specific finalization. virtual void FinishImpl(); /// \brief Finish emission of machine code. void Finish(); virtual bool mayHaveInstructions(MCSection &Sec) const { return true; } }; /// Create a dummy machine code streamer, which does nothing. This is useful for /// timing the assembler front end. MCStreamer *createNullStreamer(MCContext &Ctx); /// Create a machine code streamer which will print out assembly for the native /// target, suitable for compiling with a native assembler. /// /// \param InstPrint - If given, the instruction printer to use. If not given /// the MCInst representation will be printed. This method takes ownership of /// InstPrint. /// /// \param CE - If given, a code emitter to use to show the instruction /// encoding inline with the assembly. This method takes ownership of \p CE. /// /// \param TAB - If given, a target asm backend to use to show the fixup /// information in conjunction with encoding information. This method takes /// ownership of \p TAB. /// /// \param ShowInst - Whether to show the MCInst representation inline with /// the assembly. MCStreamer *createAsmStreamer(MCContext &Ctx, std::unique_ptr<formatted_raw_ostream> OS, bool isVerboseAsm, bool useDwarfDirectory, MCInstPrinter *InstPrint, MCCodeEmitter *CE, MCAsmBackend *TAB, bool ShowInst); } // end namespace llvm #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
//===-- DWARFAttribute.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef SymbolFileDWARF_DWARFAttribute_h_ #define SymbolFileDWARF_DWARFAttribute_h_ #include "DWARFDefines.h" #include "llvm/ADT/SmallVector.h" #include <vector> class DWARFCompileUnit; class DWARFFormValue; class DWARFAttribute { public: DWARFAttribute(dw_attr_t attr, dw_form_t form) : m_attr(attr), m_form(form) {} void set(dw_attr_t attr, dw_form_t form) { m_attr = attr; m_form = form; } void set_attr(dw_attr_t attr) { m_attr = attr; } void set_form(dw_form_t form) { m_form = form; } dw_attr_t get_attr() const { return m_attr; } dw_form_t get_form() const { return m_form; } void get(dw_attr_t &attr, dw_form_t &form) const { attr = m_attr; form = m_form; } bool operator==(const DWARFAttribute &rhs) const { return m_attr == rhs.m_attr && m_form == rhs.m_form; } typedef std::vector<DWARFAttribute> collection; typedef collection::iterator iterator; typedef collection::const_iterator const_iterator; protected: dw_attr_t m_attr; dw_form_t m_form; }; class DWARFAttributes { public: DWARFAttributes(); ~DWARFAttributes(); void Append(const DWARFCompileUnit *cu, dw_offset_t attr_die_offset, dw_attr_t attr, dw_form_t form); const DWARFCompileUnit *CompileUnitAtIndex(uint32_t i) const { return m_infos[i].cu; } dw_offset_t DIEOffsetAtIndex(uint32_t i) const { return m_infos[i].die_offset; } dw_attr_t AttributeAtIndex(uint32_t i) const { return m_infos[i].attr.get_attr(); } dw_attr_t FormAtIndex(uint32_t i) const { return m_infos[i].attr.get_form(); } bool ExtractFormValueAtIndex(uint32_t i, DWARFFormValue &form_value) const; uint64_t FormValueAsUnsignedAtIndex(uint32_t i, uint64_t fail_value) const; uint64_t FormValueAsUnsigned(dw_attr_t attr, uint64_t fail_value) const; uint32_t FindAttributeIndex(dw_attr_t attr) const; bool ContainsAttribute(dw_attr_t attr) const; bool RemoveAttribute(dw_attr_t attr); void Clear() { m_infos.clear(); } size_t Size() const { return m_infos.size(); } protected: struct AttributeValue { const DWARFCompileUnit *cu; // Keep the compile unit with each attribute in // case we have DW_FORM_ref_addr values dw_offset_t die_offset; DWARFAttribute attr; }; typedef llvm::SmallVector<AttributeValue, 8> collection; collection m_infos; }; #endif // SymbolFileDWARF_DWARFAttribute_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h
<filename>SymbolExtractorAndRenamer/lldb/source/Plugins/Process/Linux/NativeRegisterContextLinux_mips64.h //===-- NativeRegisterContextLinux_mips64.h ---------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #if defined(__mips__) #ifndef lldb_NativeRegisterContextLinux_mips64_h #define lldb_NativeRegisterContextLinux_mips64_h #include "Plugins/Process/Linux/NativeRegisterContextLinux.h" #include "Plugins/Process/Utility/RegisterContext_mips.h" #include "Plugins/Process/Utility/lldb-mips-linux-register-enums.h" #define MAX_NUM_WP 8 namespace lldb_private { namespace process_linux { class NativeProcessLinux; class NativeRegisterContextLinux_mips64 : public NativeRegisterContextLinux { public: NativeRegisterContextLinux_mips64(const ArchSpec &target_arch, NativeThreadProtocol &native_thread, uint32_t concrete_frame_idx); uint32_t GetRegisterSetCount() const override; lldb::addr_t GetPCfromBreakpointLocation( lldb::addr_t fail_value = LLDB_INVALID_ADDRESS) override; lldb::addr_t GetWatchpointHitAddress(uint32_t wp_index) override; const RegisterSet *GetRegisterSet(uint32_t set_index) const override; Error ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value) override; Error WriteRegister(const RegisterInfo *reg_info, const RegisterValue &reg_value) override; Error ReadAllRegisterValues(lldb::DataBufferSP &data_sp) override; Error WriteAllRegisterValues(const lldb::DataBufferSP &data_sp) override; Error ReadCP1(); Error WriteCP1(); uint8_t *ReturnFPOffset(uint8_t reg_index, uint32_t byte_offset); Error IsWatchpointHit(uint32_t wp_index, bool &is_hit) override; Error GetWatchpointHitIndex(uint32_t &wp_index, lldb::addr_t trap_addr) override; Error IsWatchpointVacant(uint32_t wp_index, bool &is_vacant) override; bool ClearHardwareWatchpoint(uint32_t wp_index) override; Error ClearAllHardwareWatchpoints() override; Error SetHardwareWatchpointWithIndex(lldb::addr_t addr, size_t size, uint32_t watch_flags, uint32_t wp_index); uint32_t SetHardwareWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags) override; lldb::addr_t GetWatchpointAddress(uint32_t wp_index) override; uint32_t NumSupportedHardwareWatchpoints() override; static bool IsMSAAvailable(); protected: Error Read_SR_Config(uint32_t offset, const char *reg_name, uint32_t size, RegisterValue &value); Error ReadRegisterRaw(uint32_t reg_index, RegisterValue &value) override; Error WriteRegisterRaw(uint32_t reg_index, const RegisterValue &value) override; Error DoReadWatchPointRegisterValue(lldb::tid_t tid, void *watch_readback); Error DoWriteWatchPointRegisterValue(lldb::tid_t tid, void *watch_readback); bool IsFR0(); bool IsFRE(); bool IsFPR(uint32_t reg_index) const; bool IsMSA(uint32_t reg_index) const; void *GetGPRBuffer() override { return &m_gpr; } void *GetFPRBuffer() override { return &m_fpr; } size_t GetFPRSize() override { return sizeof(FPR_linux_mips); } private: // Info about register ranges. struct RegInfo { uint32_t num_registers; uint32_t num_gpr_registers; uint32_t num_fpr_registers; uint32_t last_gpr; uint32_t first_fpr; uint32_t last_fpr; uint32_t first_msa; uint32_t last_msa; }; RegInfo m_reg_info; GPR_linux_mips m_gpr; FPR_linux_mips m_fpr; MSA_linux_mips m_msa; lldb::addr_t hw_addr_map[MAX_NUM_WP]; IOVEC_mips m_iovec; }; } // namespace process_linux } // namespace lldb_private #endif // #ifndef lldb_NativeRegisterContextLinux_mips64_h #endif // defined (__mips__)
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/include/clang/APINotes/APINotesReader.h
//===--- APINotesReader.h - API Notes Reader ----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines the \c APINotesReader class that reads source // API notes data providing additional information about source code as // a separate input, such as the non-nil/nilable annotations for // method parameters. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_API_NOTES_READER_H #define LLVM_CLANG_API_NOTES_READER_H #include "clang/APINotes/Types.h" #include "clang/Basic/VersionTuple.h" #include "llvm/ADT/Optional.h" #include "llvm/Support/MemoryBuffer.h" #include <memory> namespace clang { namespace api_notes { /// A class that reads API notes data from a binary file that was written by /// the \c APINotesWriter. class APINotesReader { class Implementation; Implementation &Impl; APINotesReader(llvm::MemoryBuffer *inputBuffer, bool ownsInputBuffer, VersionTuple swiftVersion, bool &failed); public: /// Create a new API notes reader from the given member buffer, which /// contains the contents of a binary API notes file. /// /// \returns the new API notes reader, or null if an error occurred. static std::unique_ptr<APINotesReader> get(std::unique_ptr<llvm::MemoryBuffer> inputBuffer, VersionTuple swiftVersion); /// Create a new API notes reader from the given member buffer, which /// contains the contents of a binary API notes file. /// /// \returns the new API notes reader, or null if an error occurred. static std::unique_ptr<APINotesReader> getUnmanaged(llvm::MemoryBuffer *inputBuffer, VersionTuple swiftVersion); ~APINotesReader(); APINotesReader(const APINotesReader &) = delete; APINotesReader &operator=(const APINotesReader &) = delete; /// Retrieve the name of the module for which this reader is providing API /// notes. StringRef getModuleName() const; /// Retrieve the size and modification time of the source file from /// which this API notes file was created, if known. Optional<std::pair<off_t, time_t>> getSourceFileSizeAndModTime() const; /// Retrieve the module options ModuleOptions getModuleOptions() const; /// Captures the completed versioned information for a particular part of /// API notes, including both unversioned API notes and each versioned API /// note for that particular entity. template<typename T> class VersionedInfo { /// The complete set of results. SmallVector<std::pair<VersionTuple, T>, 1> Results; /// The index of the result that is the "selected" set based on the desired /// Swift version, or \c Results.size() if nothing matched. unsigned Selected; public: /// Form an empty set of versioned information. VersionedInfo(llvm::NoneType) : Selected(0) { } /// Form a versioned info set given the desired version and a set of /// results. VersionedInfo(VersionTuple version, SmallVector<std::pair<VersionTuple, T>, 1> results); /// Determine whether there is a result that should be applied directly /// to the AST. explicit operator bool() const { return Selected != size(); } /// Retrieve the information to apply directly to the AST. const T& operator*() const { assert(*this && "No result to apply directly"); return (*this)[Selected].second; } /// Retrieve the selected index in the result set. Optional<unsigned> getSelected() const { if (Selected == Results.size()) return None; return Selected; } /// Return the number of versioned results we know about. unsigned size() const { return Results.size(); } /// Access all versioned results. const std::pair<VersionTuple, T> *begin() const { return Results.begin(); } const std::pair<VersionTuple, T> *end() const { return Results.end(); } /// Access a specific versioned result. const std::pair<VersionTuple, T> &operator[](unsigned index) const { return Results[index]; } }; /// Look for the context ID of the given Objective-C class. /// /// \param name The name of the class we're looking for. /// /// \returns The ID, if known. Optional<ContextID> lookupObjCClassID(StringRef name); /// Look for information regarding the given Objective-C class. /// /// \param name The name of the class we're looking for. /// /// \returns The information about the class, if known. VersionedInfo<ObjCContextInfo> lookupObjCClassInfo(StringRef name); /// Look for the context ID of the given Objective-C protocol. /// /// \param name The name of the protocol we're looking for. /// /// \returns The ID of the protocol, if known. Optional<ContextID> lookupObjCProtocolID(StringRef name); /// Look for information regarding the given Objective-C protocol. /// /// \param name The name of the protocol we're looking for. /// /// \returns The information about the protocol, if known. VersionedInfo<ObjCContextInfo> lookupObjCProtocolInfo(StringRef name); /// Look for information regarding the given Objective-C property in /// the given context. /// /// \param contextID The ID that references the context we are looking for. /// \param name The name of the property we're looking for. /// \param isInstance Whether we are looking for an instance property (vs. /// a class property). /// /// \returns Information about the property, if known. VersionedInfo<ObjCPropertyInfo> lookupObjCProperty(ContextID contextID, StringRef name, bool isInstance); /// Look for information regarding the given Objective-C method in /// the given context. /// /// \param contextID The ID that references the context we are looking for. /// \param selector The selector naming the method we're looking for. /// \param isInstanceMethod Whether we are looking for an instance method. /// /// \returns Information about the method, if known. VersionedInfo<ObjCMethodInfo> lookupObjCMethod(ContextID contextID, ObjCSelectorRef selector, bool isInstanceMethod); /// Look for information regarding the given global variable. /// /// \param name The name of the global variable. /// /// \returns information about the global variable, if known. VersionedInfo<GlobalVariableInfo> lookupGlobalVariable(StringRef name); /// Look for information regarding the given global function. /// /// \param name The name of the global function. /// /// \returns information about the global function, if known. VersionedInfo<GlobalFunctionInfo> lookupGlobalFunction(StringRef name); /// Look for information regarding the given enumerator. /// /// \param name The name of the enumerator. /// /// \returns information about the enumerator, if known. VersionedInfo<EnumConstantInfo> lookupEnumConstant(StringRef name); /// Look for information regarding the given tag /// (struct/union/enum/C++ class). /// /// \param name The name of the tag. /// /// \returns information about the tag, if known. VersionedInfo<TagInfo> lookupTag(StringRef name); /// Look for information regarding the given typedef. /// /// \param name The name of the typedef. /// /// \returns information about the typedef, if known. VersionedInfo<TypedefInfo> lookupTypedef(StringRef name); /// Visitor used when walking the contents of the API notes file. class Visitor { public: virtual ~Visitor(); /// Visit an Objective-C class. virtual void visitObjCClass(ContextID contextID, StringRef name, const ObjCContextInfo &info, VersionTuple swiftVersion); /// Visit an Objective-C protocol. virtual void visitObjCProtocol(ContextID contextID, StringRef name, const ObjCContextInfo &info, VersionTuple swiftVersion); /// Visit an Objective-C method. virtual void visitObjCMethod(ContextID contextID, StringRef selector, bool isInstanceMethod, const ObjCMethodInfo &info, VersionTuple swiftVersion); /// Visit an Objective-C property. virtual void visitObjCProperty(ContextID contextID, StringRef name, bool isInstance, const ObjCPropertyInfo &info, VersionTuple swiftVersion); /// Visit a global variable. virtual void visitGlobalVariable(StringRef name, const GlobalVariableInfo &info, VersionTuple swiftVersion); /// Visit a global function. virtual void visitGlobalFunction(StringRef name, const GlobalFunctionInfo &info, VersionTuple swiftVersion); /// Visit an enumerator. virtual void visitEnumConstant(StringRef name, const EnumConstantInfo &info, VersionTuple swiftVersion); /// Visit a tag. virtual void visitTag(StringRef name, const TagInfo &info, VersionTuple swiftVersion); /// Visit a typedef. virtual void visitTypedef(StringRef name, const TypedefInfo &info, VersionTuple swiftVersion); }; /// Visit the contents of the API notes file, passing each entity to the /// given visitor. void visit(Visitor &visitor); }; } // end namespace api_notes } // end namespace clang #endif // LLVM_CLANG_API_NOTES_READER_H
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/DataExtractor.h
//===-- DataExtractor.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_DataExtractor_h_ #define liblldb_DataExtractor_h_ // C Includes #include <limits.h> #include <stdint.h> #include <string.h> // C++ Includes // Other libraries and framework includes #include "llvm/ADT/SmallVector.h" // Project includes #include "lldb/lldb-private.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class DataExtractor DataExtractor.h "lldb/Core/DataExtractor.h" /// @brief An data extractor class. /// /// DataExtractor is a class that can extract data (swapping if needed) /// from a data buffer. The data buffer can be caller owned, or can be /// shared data that can be shared between multiple DataExtractor /// instances. Multiple DataExtractor objects can share the same data, /// yet extract values in different address sizes and byte order modes. /// Each object can have a unique position in the shared data and extract /// data from different offsets. /// /// @see DataBuffer //---------------------------------------------------------------------- class DataExtractor { public: //------------------------------------------------------------------ /// @typedef DataExtractor::Type /// @brief Type enumerations used in the dump routines. /// @see DataExtractor::Dump() /// @see DataExtractor::DumpRawHexBytes() //------------------------------------------------------------------ typedef enum { TypeUInt8, ///< Format output as unsigned 8 bit integers TypeChar, ///< Format output as characters TypeUInt16, ///< Format output as unsigned 16 bit integers TypeUInt32, ///< Format output as unsigned 32 bit integers TypeUInt64, ///< Format output as unsigned 64 bit integers TypePointer, ///< Format output as pointers TypeULEB128, ///< Format output as ULEB128 numbers TypeSLEB128 ///< Format output as SLEB128 numbers } Type; static void DumpHexBytes(Stream *s, const void *src, size_t src_len, uint32_t bytes_per_line, lldb::addr_t base_addr); // Pass LLDB_INVALID_ADDRESS // to not show address at // start of line //------------------------------------------------------------------ /// Default constructor. /// /// Initialize all members to a default empty state. //------------------------------------------------------------------ DataExtractor(); //------------------------------------------------------------------ /// Construct with a buffer that is owned by the caller. /// /// This constructor allows us to use data that is owned by the /// caller. The data must stay around as long as this object is /// valid. /// /// @param[in] data /// A pointer to caller owned data. /// /// @param[in] data_length /// The length in bytes of \a data. /// /// @param[in] byte_order /// A byte order of the data that we are extracting from. /// /// @param[in] addr_size /// A new address byte size value. /// /// @param[in] target_byte_size /// A size of a target byte in 8-bit host bytes //------------------------------------------------------------------ DataExtractor(const void *data, lldb::offset_t data_length, lldb::ByteOrder byte_order, uint32_t addr_size, uint32_t target_byte_size = 1); //------------------------------------------------------------------ /// Construct with shared data. /// /// Copies the data shared pointer which adds a reference to the /// contained in \a data_sp. The shared data reference is reference /// counted to ensure the data lives as long as anyone still has a /// valid shared pointer to the data in \a data_sp. /// /// @param[in] data_sp /// A shared pointer to data. /// /// @param[in] byte_order /// A byte order of the data that we are extracting from. /// /// @param[in] addr_size /// A new address byte size value. /// /// @param[in] target_byte_size /// A size of a target byte in 8-bit host bytes //------------------------------------------------------------------ DataExtractor(const lldb::DataBufferSP &data_sp, lldb::ByteOrder byte_order, uint32_t addr_size, uint32_t target_byte_size = 1); //------------------------------------------------------------------ /// Construct with a subset of \a data. /// /// Initialize this object with a subset of the data bytes in \a /// data. If \a data contains shared data, then a reference to the /// shared data will be added to ensure the shared data stays around /// as long as any objects have references to the shared data. The /// byte order value and the address size settings are copied from \a /// data. If \a offset is not a valid offset in \a data, then no /// reference to the shared data will be added. If there are not /// \a length bytes available in \a data starting at \a offset, /// the length will be truncated to contain as many bytes as /// possible. /// /// @param[in] data /// Another DataExtractor object that contains data. /// /// @param[in] offset /// The offset into \a data at which the subset starts. /// /// @param[in] length /// The length in bytes of the subset of data. /// /// @param[in] target_byte_size /// A size of a target byte in 8-bit host bytes //------------------------------------------------------------------ DataExtractor(const DataExtractor &data, lldb::offset_t offset, lldb::offset_t length, uint32_t target_byte_size = 1); DataExtractor(const DataExtractor &rhs); //------------------------------------------------------------------ /// Assignment operator. /// /// Copies all data, byte order and address size settings from \a rhs into /// this object. If \a rhs contains shared data, a reference to that /// shared data will be added. /// /// @param[in] rhs /// Another DataExtractor object to copy. /// /// @return /// A const reference to this object. //------------------------------------------------------------------ const DataExtractor &operator=(const DataExtractor &rhs); //------------------------------------------------------------------ /// Destructor /// /// If this object contains a valid shared data reference, the /// reference count on the data will be decremented, and if zero, /// the data will be freed. //------------------------------------------------------------------ ~DataExtractor(); //------------------------------------------------------------------ /// Clears the object state. /// /// Clears the object contents back to a default invalid state, and /// release any references to shared data that this object may /// contain. //------------------------------------------------------------------ void Clear(); //------------------------------------------------------------------ /// Dumps the binary data as \a type objects to stream \a s (or to /// Log() if \a s is nullptr) starting \a offset bytes into the data /// and stopping after dumping \a length bytes. The offset into the /// data is displayed at the beginning of each line and can be /// offset by base address \a base_addr. \a num_per_line objects /// will be displayed on each line. /// /// @param[in] s /// The stream to dump the output to. If nullptr the output will /// be dumped to Log(). /// /// @param[in] offset /// The offset into the data at which to start dumping. /// /// @param[in] length /// The number of bytes to dump. /// /// @param[in] base_addr /// The base address that gets added to the offset displayed on /// each line. /// /// @param[in] num_per_line /// The number of \a type objects to display on each line. /// /// @param[in] type /// The type of objects to use when dumping data from this /// object. See DataExtractor::Type. /// /// @param[in] type_format /// The optional format to use for the \a type objects. If this /// is nullptr, the default format for the \a type will be used. /// /// @return /// The offset at which dumping ended. //------------------------------------------------------------------ lldb::offset_t PutToLog(Log *log, lldb::offset_t offset, lldb::offset_t length, uint64_t base_addr, uint32_t num_per_line, Type type, const char *type_format = nullptr) const; //------------------------------------------------------------------ /// Dumps \a item_count objects into the stream \a s. /// /// Dumps \a item_count objects using \a item_format, each of which /// are \a item_byte_size bytes long starting at offset \a offset /// bytes into the contained data, into the stream \a s. \a /// num_per_line objects will be dumped on each line before a new /// line will be output. If \a base_addr is a valid address, then /// each new line of output will be preceded by the address value /// plus appropriate offset, and a colon and space. Bitfield values /// can be dumped by calling this function multiple times with the /// same start offset, format and size, yet differing \a /// item_bit_size and \a item_bit_offset values. /// /// @param[in] s /// The stream to dump the output to. This value can not be nullptr. /// /// @param[in] offset /// The offset into the data at which to start dumping. /// /// @param[in] item_format /// The format to use when dumping each item. /// /// @param[in] item_byte_size /// The byte size of each item. /// /// @param[in] item_count /// The number of items to dump. /// /// @param[in] num_per_line /// The number of items to display on each line. /// /// @param[in] base_addr /// The base address that gets added to the offset displayed on /// each line if the value is valid. Is \a base_addr is /// LLDB_INVALID_ADDRESS then no address values will be prepended /// to any lines. /// /// @param[in] item_bit_size /// If the value to display is a bitfield, this value should /// be the number of bits that the bitfield item has within the /// item's byte size value. This function will need to be called /// multiple times with identical \a offset and \a item_byte_size /// values in order to display multiple bitfield values that /// exist within the same integer value. If the items being /// displayed are not bitfields, this value should be zero. /// /// @param[in] item_bit_offset /// If the value to display is a bitfield, this value should /// be the offset in bits, or shift right amount, that the /// bitfield item occupies within the item's byte size value. /// This function will need to be called multiple times with /// identical \a offset and \a item_byte_size values in order /// to display multiple bitfield values that exist within the /// same integer value. If the items being displayed are not /// bitfields, this value should be zero. /// /// @return /// The offset at which dumping ended. //------------------------------------------------------------------ lldb::offset_t Dump(Stream *s, lldb::offset_t offset, lldb::Format item_format, size_t item_byte_size, size_t item_count, size_t num_per_line, uint64_t base_addr, uint32_t item_bit_size, uint32_t item_bit_offset, ExecutionContextScope *exe_scope = nullptr) const; //------------------------------------------------------------------ /// Dump a UUID value at \a offset. /// /// Dump a UUID starting at \a offset bytes into this object's data. /// If the stream \a s is nullptr, the output will be sent to Log(). /// /// @param[in] s /// The stream to dump the output to. If nullptr the output will /// be dumped to Log(). /// /// @param[in] offset /// The offset into the data at which to extract and dump a /// UUID value. //------------------------------------------------------------------ void DumpUUID(Stream *s, lldb::offset_t offset) const; //------------------------------------------------------------------ /// Extract an arbitrary number of bytes in the specified byte /// order. /// /// Attemps to extract \a length bytes starting at \a offset bytes /// into this data in the requested byte order (\a dst_byte_order) /// and place the results in \a dst. \a dst must be at least \a /// length bytes long. /// /// @param[in] offset /// The offset in bytes into the contained data at which to /// start extracting. /// /// @param[in] length /// The number of bytes to extract. /// /// @param[in] dst_byte_order /// A byte order of the data that we want when the value in /// copied to \a dst. /// /// @param[out] dst /// The buffer that will receive the extracted value if there /// are enough bytes available in the current data. /// /// @return /// The number of bytes that were extracted which will be \a /// length when the value is successfully extracted, or zero /// if there aren't enough bytes at the specified offset. //------------------------------------------------------------------ size_t ExtractBytes(lldb::offset_t offset, lldb::offset_t length, lldb::ByteOrder dst_byte_order, void *dst) const; //------------------------------------------------------------------ /// Extract an address from \a *offset_ptr. /// /// Extract a single address from the data and update the offset /// pointed to by \a offset_ptr. The size of the extracted address /// comes from the \a m_addr_size member variable and should be /// set correctly prior to extracting any address values. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted address value. //------------------------------------------------------------------ uint64_t GetAddress(lldb::offset_t *offset_ptr) const; uint64_t GetAddress_unchecked(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Get the current address size. /// /// Return the size in bytes of any address values this object will /// extract. /// /// @return /// The size in bytes of address values that will be extracted. //------------------------------------------------------------------ uint32_t GetAddressByteSize() const { return m_addr_size; } //------------------------------------------------------------------ /// Get the number of bytes contained in this object. /// /// @return /// The total number of bytes of data this object refers to. //------------------------------------------------------------------ uint64_t GetByteSize() const { return m_end - m_start; } //------------------------------------------------------------------ /// Extract a C string from \a *offset_ptr. /// /// Returns a pointer to a C String from the data at the offset /// pointed to by \a offset_ptr. A variable length NULL terminated C /// string will be extracted and the \a offset_ptr will be /// updated with the offset of the byte that follows the NULL /// terminator byte. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// A pointer to the C string value in the data. If the offset /// pointed to by \a offset_ptr is out of bounds, or if the /// offset plus the length of the C string is out of bounds, /// nullptr will be returned. //------------------------------------------------------------------ const char *GetCStr(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Extract a C string from \a *offset_ptr with field size \a len. /// /// Returns a pointer to a C String from the data at the offset /// pointed to by \a offset_ptr, with a field length of \a len. /// A NULL terminated C string will be extracted and the \a offset_ptr /// will be updated with the offset of the byte that follows the fixed /// length field. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// A pointer to the C string value in the data. If the offset /// pointed to by \a offset_ptr is out of bounds, or if the /// offset plus the length of the field is out of bounds, or if /// the field does not contain a NULL terminator byte, nullptr will /// be returned. const char *GetCStr(lldb::offset_t *offset_ptr, lldb::offset_t len) const; //------------------------------------------------------------------ /// Extract \a length bytes from \a *offset_ptr. /// /// Returns a pointer to a bytes in this object's data at the offset /// pointed to by \a offset_ptr. If \a length is zero or too large, /// then the offset pointed to by \a offset_ptr will not be updated /// and nullptr will be returned. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[in] length /// The optional length of a string to extract. If the value is /// zero, a NULL terminated C string will be extracted. /// /// @return /// A pointer to the bytes in this object's data if the offset /// and length are valid, or nullptr otherwise. //------------------------------------------------------------------ const void *GetData(lldb::offset_t *offset_ptr, lldb::offset_t length) const { const uint8_t *ptr = PeekData(*offset_ptr, length); if (ptr) *offset_ptr += length; return ptr; } //------------------------------------------------------------------ /// Copy \a length bytes from \a *offset, without swapping bytes. /// /// @param[in] offset /// The offset into this data from which to start copying /// /// @param[in] length /// The length of the data to copy from this object /// /// @param[out] dst /// The buffer to place the output data. /// /// @return /// Returns the number of bytes that were copied, or zero if /// anything goes wrong. //------------------------------------------------------------------ lldb::offset_t CopyData(lldb::offset_t offset, lldb::offset_t length, void *dst) const; //------------------------------------------------------------------ /// Copy \a dst_len bytes from \a *offset_ptr and ensure the copied /// data is treated as a value that can be swapped to match the /// specified byte order. /// /// For values that are larger than the supported integer sizes, /// this function can be used to extract data in a specified byte /// order. It can also be used to copy a smaller integer value from /// to a larger value. The extra bytes left over will be padded /// correctly according to the byte order of this object and the /// \a dst_byte_order. This can be very handy when say copying a /// partial data value into a register. /// /// @param[in] src_offset /// The offset into this data from which to start copying an /// endian entity /// /// @param[in] src_len /// The length of the endian data to copy from this object /// into the \a dst object /// /// @param[out] dst /// The buffer where to place the endian data. The data might /// need to be byte swapped (and appropriately padded with /// zeroes if \a src_len != \a dst_len) if \a dst_byte_order /// does not match the byte order in this object. /// /// @param[in] dst_len /// The length number of bytes that the endian value will /// occupy is \a dst. /// /// @param[in] byte_order /// The byte order that the endian value should be in the \a dst /// buffer. /// /// @return /// Returns the number of bytes that were copied, or zero if /// anything goes wrong. //------------------------------------------------------------------ lldb::offset_t CopyByteOrderedData(lldb::offset_t src_offset, lldb::offset_t src_len, void *dst, lldb::offset_t dst_len, lldb::ByteOrder dst_byte_order) const; //------------------------------------------------------------------ /// Get the data end pointer. /// /// @return /// Returns a pointer to the next byte contained in this /// object's data, or nullptr of there is no data in this object. //------------------------------------------------------------------ const uint8_t *GetDataEnd() const { return m_end; } //------------------------------------------------------------------ /// Get the shared data offset. /// /// Get the offset of the first byte of data in the shared data (if /// any). /// /// @return /// If this object contains shared data, this function returns /// the offset in bytes into that shared data, zero otherwise. //------------------------------------------------------------------ size_t GetSharedDataOffset() const; //------------------------------------------------------------------ /// Get the data start pointer. /// /// @return /// Returns a pointer to the first byte contained in this /// object's data, or nullptr of there is no data in this object. //------------------------------------------------------------------ const uint8_t *GetDataStart() const { return m_start; } //------------------------------------------------------------------ /// Extract a float from \a *offset_ptr. /// /// Extract a single float value. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The floating value that was extracted, or zero on failure. //------------------------------------------------------------------ float GetFloat(lldb::offset_t *offset_ptr) const; double GetDouble(lldb::offset_t *offset_ptr) const; long double GetLongDouble(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Extract a GNU encoded pointer value from \a *offset_ptr. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[in] eh_ptr_enc /// The GNU pointer encoding type. /// /// @param[in] pc_rel_addr /// The PC relative address to use when the encoding is /// \c DW_GNU_EH_PE_pcrel. /// /// @param[in] text_addr /// The text (code) relative address to use when the encoding is /// \c DW_GNU_EH_PE_textrel. /// /// @param[in] data_addr /// The data relative address to use when the encoding is /// \c DW_GNU_EH_PE_datarel. /// /// @return /// The extracted GNU encoded pointer value. //------------------------------------------------------------------ uint64_t GetGNUEHPointer(lldb::offset_t *offset_ptr, uint32_t eh_ptr_enc, lldb::addr_t pc_rel_addr, lldb::addr_t text_addr, lldb::addr_t data_addr); //------------------------------------------------------------------ /// Extract an integer of size \a byte_size from \a *offset_ptr. /// /// Extract a single integer value and update the offset pointed to /// by \a offset_ptr. The size of the extracted integer is specified /// by the \a byte_size argument. \a byte_size should have a value /// >= 1 and <= 4 since the return value is only 32 bits wide. Any /// \a byte_size values less than 1 or greater than 4 will result in /// nothing being extracted, and zero being returned. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[in] byte_size /// The size in byte of the integer to extract. /// /// @return /// The integer value that was extracted, or zero on failure. //------------------------------------------------------------------ uint32_t GetMaxU32(lldb::offset_t *offset_ptr, size_t byte_size) const; //------------------------------------------------------------------ /// Extract an unsigned integer of size \a byte_size from \a /// *offset_ptr. /// /// Extract a single unsigned integer value and update the offset /// pointed to by \a offset_ptr. The size of the extracted integer /// is specified by the \a byte_size argument. \a byte_size should /// have a value greater than or equal to one and less than or equal /// to eight since the return value is 64 bits wide. Any /// \a byte_size values less than 1 or greater than 8 will result in /// nothing being extracted, and zero being returned. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[in] byte_size /// The size in byte of the integer to extract. /// /// @return /// The unsigned integer value that was extracted, or zero on /// failure. //------------------------------------------------------------------ uint64_t GetMaxU64(lldb::offset_t *offset_ptr, size_t byte_size) const; uint64_t GetMaxU64_unchecked(lldb::offset_t *offset_ptr, size_t byte_size) const; //------------------------------------------------------------------ /// Extract an signed integer of size \a byte_size from \a *offset_ptr. /// /// Extract a single signed integer value (sign extending if required) /// and update the offset pointed to by \a offset_ptr. The size of /// the extracted integer is specified by the \a byte_size argument. /// \a byte_size should have a value greater than or equal to one /// and less than or equal to eight since the return value is 64 /// bits wide. Any \a byte_size values less than 1 or greater than /// 8 will result in nothing being extracted, and zero being returned. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[in] byte_size /// The size in byte of the integer to extract. /// /// @return /// The sign extended signed integer value that was extracted, /// or zero on failure. //------------------------------------------------------------------ int64_t GetMaxS64(lldb::offset_t *offset_ptr, size_t size) const; //------------------------------------------------------------------ /// Extract an unsigned integer of size \a byte_size from \a /// *offset_ptr, then extract the bitfield from this value if /// \a bitfield_bit_size is non-zero. /// /// Extract a single unsigned integer value and update the offset /// pointed to by \a offset_ptr. The size of the extracted integer /// is specified by the \a byte_size argument. \a byte_size should /// have a value greater than or equal to one and less than or equal /// to 8 since the return value is 64 bits wide. Any /// \a byte_size values less than 1 or greater than 8 will result in /// nothing being extracted, and zero being returned. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[in] byte_size /// The size in byte of the integer to extract. /// /// @param[in] bitfield_bit_size /// The size in bits of the bitfield value to extract, or zero /// to just extract the entire integer value. /// /// @param[in] bitfield_bit_offset /// The bit offset of the bitfield value in the extracted /// integer. For little-endian data, this is the offset of /// the LSB of the bitfield from the LSB of the integer. /// For big-endian data, this is the offset of the MSB of the /// bitfield from the MSB of the integer. /// /// @return /// The unsigned bitfield integer value that was extracted, or /// zero on failure. //------------------------------------------------------------------ uint64_t GetMaxU64Bitfield(lldb::offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const; //------------------------------------------------------------------ /// Extract an signed integer of size \a byte_size from \a /// *offset_ptr, then extract and signe extend the bitfield from /// this value if \a bitfield_bit_size is non-zero. /// /// Extract a single signed integer value (sign extending if required) /// and update the offset pointed to by \a offset_ptr. The size of /// the extracted integer is specified by the \a byte_size argument. /// \a byte_size should have a value greater than or equal to one /// and less than or equal to eight since the return value is 64 /// bits wide. Any \a byte_size values less than 1 or greater than /// 8 will result in nothing being extracted, and zero being returned. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[in] byte_size /// The size in bytes of the integer to extract. /// /// @param[in] bitfield_bit_size /// The size in bits of the bitfield value to extract, or zero /// to just extract the entire integer value. /// /// @param[in] bitfield_bit_offset /// The bit offset of the bitfield value in the extracted /// integer. For little-endian data, this is the offset of /// the LSB of the bitfield from the LSB of the integer. /// For big-endian data, this is the offset of the MSB of the /// bitfield from the MSB of the integer. /// /// @return /// The signed bitfield integer value that was extracted, or /// zero on failure. //------------------------------------------------------------------ int64_t GetMaxS64Bitfield(lldb::offset_t *offset_ptr, size_t size, uint32_t bitfield_bit_size, uint32_t bitfield_bit_offset) const; //------------------------------------------------------------------ /// Extract an pointer from \a *offset_ptr. /// /// Extract a single pointer from the data and update the offset /// pointed to by \a offset_ptr. The size of the extracted pointer /// comes from the \a m_addr_size member variable and should be /// set correctly prior to extracting any pointer values. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted pointer value as a 64 integer. //------------------------------------------------------------------ uint64_t GetPointer(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Get the current byte order value. /// /// @return /// The current byte order value from this object's internal /// state. //------------------------------------------------------------------ lldb::ByteOrder GetByteOrder() const { return m_byte_order; } //------------------------------------------------------------------ /// Extract a uint8_t value from \a *offset_ptr. /// /// Extract a single uint8_t from the binary data at the offset /// pointed to by \a offset_ptr, and advance the offset on success. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted uint8_t value. //------------------------------------------------------------------ uint8_t GetU8(lldb::offset_t *offset_ptr) const; uint8_t GetU8_unchecked(lldb::offset_t *offset_ptr) const { uint8_t val = m_start[*offset_ptr]; *offset_ptr += 1; return val; } uint16_t GetU16_unchecked(lldb::offset_t *offset_ptr) const; uint32_t GetU32_unchecked(lldb::offset_t *offset_ptr) const; uint64_t GetU64_unchecked(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Extract \a count uint8_t values from \a *offset_ptr. /// /// Extract \a count uint8_t values from the binary data at the /// offset pointed to by \a offset_ptr, and advance the offset on /// success. The extracted values are copied into \a dst. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[out] dst /// A buffer to copy \a count uint8_t values into. \a dst must /// be large enough to hold all requested data. /// /// @param[in] count /// The number of uint8_t values to extract. /// /// @return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. //------------------------------------------------------------------ void *GetU8(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; //------------------------------------------------------------------ /// Extract a uint16_t value from \a *offset_ptr. /// /// Extract a single uint16_t from the binary data at the offset /// pointed to by \a offset_ptr, and update the offset on success. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted uint16_t value. //------------------------------------------------------------------ uint16_t GetU16(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Extract \a count uint16_t values from \a *offset_ptr. /// /// Extract \a count uint16_t values from the binary data at the /// offset pointed to by \a offset_ptr, and advance the offset on /// success. The extracted values are copied into \a dst. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[out] dst /// A buffer to copy \a count uint16_t values into. \a dst must /// be large enough to hold all requested data. /// /// @param[in] count /// The number of uint16_t values to extract. /// /// @return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. //------------------------------------------------------------------ void *GetU16(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; //------------------------------------------------------------------ /// Extract a uint32_t value from \a *offset_ptr. /// /// Extract a single uint32_t from the binary data at the offset /// pointed to by \a offset_ptr, and update the offset on success. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted uint32_t value. //------------------------------------------------------------------ uint32_t GetU32(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Extract \a count uint32_t values from \a *offset_ptr. /// /// Extract \a count uint32_t values from the binary data at the /// offset pointed to by \a offset_ptr, and advance the offset on /// success. The extracted values are copied into \a dst. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[out] dst /// A buffer to copy \a count uint32_t values into. \a dst must /// be large enough to hold all requested data. /// /// @param[in] count /// The number of uint32_t values to extract. /// /// @return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. //------------------------------------------------------------------ void *GetU32(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; //------------------------------------------------------------------ /// Extract a uint64_t value from \a *offset_ptr. /// /// Extract a single uint64_t from the binary data at the offset /// pointed to by \a offset_ptr, and update the offset on success. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted uint64_t value. //------------------------------------------------------------------ uint64_t GetU64(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Extract \a count uint64_t values from \a *offset_ptr. /// /// Extract \a count uint64_t values from the binary data at the /// offset pointed to by \a offset_ptr, and advance the offset on /// success. The extracted values are copied into \a dst. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @param[out] dst /// A buffer to copy \a count uint64_t values into. \a dst must /// be large enough to hold all requested data. /// /// @param[in] count /// The number of uint64_t values to extract. /// /// @return /// \a dst if all values were properly extracted and copied, /// nullptr otherwise. //------------------------------------------------------------------ void *GetU64(lldb::offset_t *offset_ptr, void *dst, uint32_t count) const; //------------------------------------------------------------------ /// Extract a signed LEB128 value from \a *offset_ptr. /// /// Extracts an signed LEB128 number from this object's data /// starting at the offset pointed to by \a offset_ptr. The offset /// pointed to by \a offset_ptr will be updated with the offset of /// the byte following the last extracted byte. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted signed integer value. //------------------------------------------------------------------ int64_t GetSLEB128(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Extract a unsigned LEB128 value from \a *offset_ptr. /// /// Extracts an unsigned LEB128 number from this object's data /// starting at the offset pointed to by \a offset_ptr. The offset /// pointed to by \a offset_ptr will be updated with the offset of /// the byte following the last extracted byte. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return /// The extracted unsigned integer value. //------------------------------------------------------------------ uint64_t GetULEB128(lldb::offset_t *offset_ptr) const; lldb::DataBufferSP &GetSharedDataBuffer() { return m_data_sp; } //------------------------------------------------------------------ /// Peek at a C string at \a offset. /// /// Peeks at a string in the contained data. No verification is done /// to make sure the entire string lies within the bounds of this /// object's data, only \a offset is verified to be a valid offset. /// /// @param[in] offset /// An offset into the data. /// /// @return /// A non-nullptr C string pointer if \a offset is a valid offset, /// nullptr otherwise. //------------------------------------------------------------------ const char *PeekCStr(lldb::offset_t offset) const; //------------------------------------------------------------------ /// Peek at a bytes at \a offset. /// /// Returns a pointer to \a length bytes at \a offset as long as /// there are \a length bytes available starting at \a offset. /// /// @return /// A non-nullptr data pointer if \a offset is a valid offset and /// there are \a length bytes available at that offset, nullptr /// otherwise. //------------------------------------------------------------------ const uint8_t *PeekData(lldb::offset_t offset, lldb::offset_t length) const { if (ValidOffsetForDataOfSize(offset, length)) return m_start + offset; return nullptr; } //------------------------------------------------------------------ /// Set the address byte size. /// /// Set the size in bytes that will be used when extracting any /// address and pointer values from data contained in this object. /// /// @param[in] addr_size /// The size in bytes to use when extracting addresses. //------------------------------------------------------------------ void SetAddressByteSize(uint32_t addr_size) { #ifdef LLDB_CONFIGURATION_DEBUG assert(addr_size == 4 || addr_size == 8); #endif m_addr_size = addr_size; } //------------------------------------------------------------------ /// Set data with a buffer that is caller owned. /// /// Use data that is owned by the caller when extracting values. /// The data must stay around as long as this object, or any object /// that copies a subset of this object's data, is valid. If \a /// bytes is nullptr, or \a length is zero, this object will contain /// no data. /// /// @param[in] bytes /// A pointer to caller owned data. /// /// @param[in] length /// The length in bytes of \a bytes. /// /// @param[in] byte_order /// A byte order of the data that we are extracting from. /// /// @return /// The number of bytes that this object now contains. //------------------------------------------------------------------ lldb::offset_t SetData(const void *bytes, lldb::offset_t length, lldb::ByteOrder byte_order); //------------------------------------------------------------------ /// Adopt a subset of \a data. /// /// Set this object's data to be a subset of the data bytes in \a /// data. If \a data contains shared data, then a reference to the /// shared data will be added to ensure the shared data stays around /// as long as any objects have references to the shared data. The /// byte order and the address size settings are copied from \a /// data. If \a offset is not a valid offset in \a data, then no /// reference to the shared data will be added. If there are not /// \a length bytes available in \a data starting at \a offset, /// the length will be truncated to contains as many bytes as /// possible. /// /// @param[in] data /// Another DataExtractor object that contains data. /// /// @param[in] offset /// The offset into \a data at which the subset starts. /// /// @param[in] length /// The length in bytes of the subset of \a data. /// /// @return /// The number of bytes that this object now contains. //------------------------------------------------------------------ lldb::offset_t SetData(const DataExtractor &data, lldb::offset_t offset, lldb::offset_t length); //------------------------------------------------------------------ /// Adopt a subset of shared data in \a data_sp. /// /// Copies the data shared pointer which adds a reference to the /// contained in \a data_sp. The shared data reference is reference /// counted to ensure the data lives as long as anyone still has a /// valid shared pointer to the data in \a data_sp. The byte order /// and address byte size settings remain the same. If /// \a offset is not a valid offset in \a data_sp, then no reference /// to the shared data will be added. If there are not \a length /// bytes available in \a data starting at \a offset, the length /// will be truncated to contains as many bytes as possible. /// /// @param[in] data_sp /// A shared pointer to data. /// /// @param[in] offset /// The offset into \a data_sp at which the subset starts. /// /// @param[in] length /// The length in bytes of the subset of \a data_sp. /// /// @return /// The number of bytes that this object now contains. //------------------------------------------------------------------ lldb::offset_t SetData(const lldb::DataBufferSP &data_sp, lldb::offset_t offset = 0, lldb::offset_t length = LLDB_INVALID_OFFSET); //------------------------------------------------------------------ /// Set the byte_order value. /// /// Sets the byte order of the data to extract. Extracted values /// will be swapped if necessary when decoding. /// /// @param[in] byte_order /// The byte order value to use when extracting data. //------------------------------------------------------------------ void SetByteOrder(lldb::ByteOrder byte_order) { m_byte_order = byte_order; } //------------------------------------------------------------------ /// Skip an LEB128 number at \a *offset_ptr. /// /// Skips a LEB128 number (signed or unsigned) from this object's /// data starting at the offset pointed to by \a offset_ptr. The /// offset pointed to by \a offset_ptr will be updated with the /// offset of the byte following the last extracted byte. /// /// @param[in,out] offset_ptr /// A pointer to an offset within the data that will be advanced /// by the appropriate number of bytes if the value is extracted /// correctly. If the offset is out of bounds or there are not /// enough bytes to extract this value, the offset will be left /// unmodified. /// /// @return // The number of bytes consumed during the extraction. //------------------------------------------------------------------ uint32_t Skip_LEB128(lldb::offset_t *offset_ptr) const; //------------------------------------------------------------------ /// Test the validity of \a offset. /// /// @return /// \b true if \a offset is a valid offset into the data in this /// object, \b false otherwise. //------------------------------------------------------------------ bool ValidOffset(lldb::offset_t offset) const { return offset < GetByteSize(); } //------------------------------------------------------------------ /// Test the availability of \a length bytes of data from \a offset. /// /// @return /// \b true if \a offset is a valid offset and there are \a /// length bytes available at that offset, \b false otherwise. //------------------------------------------------------------------ bool ValidOffsetForDataOfSize(lldb::offset_t offset, lldb::offset_t length) const { return length <= BytesLeft(offset); } size_t Copy(DataExtractor &dest_data) const; bool Append(DataExtractor &rhs); bool Append(void *bytes, lldb::offset_t length); lldb::offset_t BytesLeft(lldb::offset_t offset) const { const lldb::offset_t size = GetByteSize(); if (size > offset) return size - offset; return 0; } void Checksum(llvm::SmallVectorImpl<uint8_t> &dest, uint64_t max_data = 0); protected: //------------------------------------------------------------------ // Member variables //------------------------------------------------------------------ const uint8_t *m_start; ///< A pointer to the first byte of data. const uint8_t *m_end; ///< A pointer to the byte that is past the end of the data. lldb::ByteOrder m_byte_order; ///< The byte order of the data we are extracting from. uint32_t m_addr_size; ///< The address size to use when extracting pointers or ///addresses mutable lldb::DataBufferSP m_data_sp; ///< The shared pointer to data that can ///be shared among multiple instances const uint32_t m_target_byte_size; }; } // namespace lldb_private #endif // liblldb_DataExtractor_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/Utils-Template.h
<filename>SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/Utils-Template.h #ifndef Utils_Template_h #define Utils_Template_h namespace swift { namespace obfuscation { template<typename ElementType> void copyToVector(const std::vector<ElementType> &FromVector, std::vector<ElementType> &ToVector) { std::copy(FromVector.cbegin(), FromVector.cend(), std::back_inserter(ToVector)); }; template<typename ElementType, typename CompareFrom> void copyToVector(const std::set<ElementType, CompareFrom> &FromSet, std::vector<ElementType> &ToVector) { std::copy(FromSet.cbegin(), FromSet.cend(), std::back_inserter(ToVector)); }; template<typename ElementType, typename CompareFrom, typename CompareTo> void copyToSet(const std::set<ElementType, CompareFrom> &FromSet, std::set<ElementType, CompareTo> &ToSet) { std::copy(FromSet.cbegin(), FromSet.cend(), std::inserter(ToSet, ToSet.begin())); }; template<typename ElementType, typename CompareTo> void copyToSet(const std::vector<ElementType> &FromVector, std::set<ElementType, CompareTo> &ToSet) { std::copy(FromVector.cbegin(), FromVector.cend(), std::inserter(ToSet, ToSet.begin())); } template<typename ElementType> void copyToStream(const std::vector<ElementType> &FromVector, std::ostream_iterator<ElementType> Inserter) { std::copy(FromVector.cbegin(), FromVector.cend(), Inserter); }; template<typename T> void removeFromVector(std::vector<T> &FromVector, const T &Element) { FromVector.erase(std::remove(FromVector.begin(), FromVector.end(), Element), FromVector.end()); }; } //namespace obfuscation } //namespace swift #endif /* Utils_Template_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/Renaming.h
<reponame>Polidea/SiriusObfuscator #ifndef Renaming_h #define Renaming_h #include "swift/Obfuscation/DataStructures.h" #include "llvm/Support/Error.h" #include <vector> #include <string> #include <utility> namespace swift { namespace obfuscation { using FilesList = std::vector<std::pair<std::string, std::string>>; /// Creates project copy in ObfuscatedProjectPath and performs symbol renaming /// defined in RenamesJson in the following steps: /// /// 1. Performs semantic analysis of the project files defined in FilesJson and /// creates AST. All input project files have to be in /// FilesJson.Project.RootPath or subdirectories. /// 2. Copies all project files to ObfuscatedProjectPath. /// 3. Walks the AST and collects symbols listed in RenamesJson. /// 4. Performs renames on collected symbols in project copy /// in ObfuscatedProjectPath using renames from RenamesJson. /// 5. Performs renames on layout files (.storyboard and .xib) /// using paths from FilesJson. More information about layouts /// renaming in LayoutRenamer.h. /// /// Typical usage: /// \code /// auto FilesOrError = performRenaming(MainExecutablePath, /// FilesJson, /// RenamesJson, /// ObfuscatedProjectPath); /// if (auto Error = FilesOrError.takeError()) { /// ExitOnError(std::move(Error)); /// } /// auto ObfuscatedFiles = FilesOrError.get() /// \endcode /// /// \param MainExecutablePath Path of the executable that invokes the semantic /// analysis. It is passed to CompilerInvocation object during Compiler setup. /// \param FilesJson Object containing unobfuscated project root path, /// and data required by CompilerInstance to perform semantic analysis, /// such as module name, input filenames, framework search paths and SDK path. /// \param RenamesJson Symbols to be renamed. Each SymbolRenaming object /// contains the new name. /// \param ObfuscatedProjectPath Path where the project copy will be created /// and renaming will be performed. /// \param ObfuscateInPlace if true then obfuscation will be performed on /// an original project (without making a copy). /// \param DiagnosticStream Stream for writing the diagnostic information into. /// /// \returns List of project files that were affected by the renaming. llvm::Expected<FilesList> performRenaming(std::string MainExecutablePath, const FilesJson &FilesJson, ObfuscationConfiguration &&ObfuscationConfiguration, const RenamesJson &RenamesJson, std::string ObfuscatedProjectPath, bool ObfuscateInPlace, llvm::raw_ostream &DiagnosticStream); } //namespace obfuscation } //namespace swift #endif /* Renaming_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/OperatingSystem/Go/OperatingSystemGo.h
<gh_stars>100-1000 //===-- OperatingSystemGo.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef _liblldb_OperatingSystemGo_h_ #define _liblldb_OperatingSystemGo_h_ // C Includes // C++ Includes #include <memory> // Other libraries and framework includes // Project includes #include "lldb/Target/OperatingSystem.h" class DynamicRegisterInfo; class OperatingSystemGo : public lldb_private::OperatingSystem { public: OperatingSystemGo(lldb_private::Process *process); ~OperatingSystemGo() override; //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ static lldb_private::OperatingSystem * CreateInstance(lldb_private::Process *process, bool force); static void Initialize(); static void DebuggerInitialize(lldb_private::Debugger &debugger); static void Terminate(); static lldb_private::ConstString GetPluginNameStatic(); static const char *GetPluginDescriptionStatic(); //------------------------------------------------------------------ // lldb_private::PluginInterface Methods //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; //------------------------------------------------------------------ // lldb_private::OperatingSystem Methods //------------------------------------------------------------------ bool UpdateThreadList(lldb_private::ThreadList &old_thread_list, lldb_private::ThreadList &real_thread_list, lldb_private::ThreadList &new_thread_list) override; void ThreadWasSelected(lldb_private::Thread *thread) override; lldb::RegisterContextSP CreateRegisterContextForThread(lldb_private::Thread *thread, lldb::addr_t reg_data_addr) override; lldb::StopInfoSP CreateThreadStopReason(lldb_private::Thread *thread) override; //------------------------------------------------------------------ // Method for lazy creation of threads on demand //------------------------------------------------------------------ lldb::ThreadSP CreateThread(lldb::tid_t tid, lldb::addr_t context) override; private: struct Goroutine; static lldb::ValueObjectSP FindGlobal(lldb::TargetSP target, const char *name); static lldb::TypeSP FindType(lldb::TargetSP target_sp, const char *name); bool Init(lldb_private::ThreadList &threads); Goroutine CreateGoroutineAtIndex(uint64_t idx, lldb_private::Error &err); std::unique_ptr<DynamicRegisterInfo> m_reginfo; lldb::ValueObjectSP m_allg_sp; lldb::ValueObjectSP m_allglen_sp; }; #endif // liblldb_OperatingSystemGo_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/CodeGen/ubsan-null.c
// RUN: %clang_cc1 -fsanitize=null -emit-llvm %s -o - | FileCheck %s struct A { int a[2]; int b; }; // CHECK-LABEL: @f1 int *f1() { // CHECK-NOT: __ubsan_handle_type_mismatch // CHECK: ret // CHECK-SAME: getelementptr inbounds (%struct.A, %struct.A* null, i32 0, i32 1) return &((struct A *)0)->b; }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Index/Store/unit-workdir-prefix.c
// XFAIL: linux #include "header.h" void foo(void) { bar(); } // RUN: rm -rf %t // RUN: mkdir -p %t/Directory // RUN: mkdir -p %t/Directory.surprise // RUN: mkdir -p %t/sdk // RUN: mkdir -p %t/sdk_other // RUN: echo "void bar(void);" > %t/sdk_other/header.h // RUN: cp %s %t/Directory.surprise/main.c // // RUN: %clang_cc1 -isystem %t/sdk_other -isysroot %t/sdk -index-store-path %t/idx %t/Directory.surprise/main.c -triple x86_64-apple-macosx10.8 -working-directory %t/Directory // RUN: c-index-test core -print-unit %t/idx | FileCheck %s // CHECK: main.c.o // CHECK: provider: clang- // CHECK: is-system: 0 // CHECK: has-main: 1 // CHECK: main-path: {{.*}}Directory.surprise{{/|\\}}main.c // CHECK: out-file: {{.*}}Directory.surprise{{/|\\}}main.c.o // CHECK: target: x86_64-apple-macosx10.8 // CHECK: is-debug: 1 // CHECK: DEPEND START // CHECK: Record | user | {{.*}}Directory.surprise{{/|\\}}main.c | main.c- // CHECK: Record | system | {{.*}}sdk_other{{/|\\}}header.h | header.h-
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/LayoutRenamer.h
<gh_stars>100-1000 #ifndef LayoutRenamer_h #define LayoutRenamer_h #include "swift/Obfuscation/DataStructures.h" #include "swift/Obfuscation/Utils.h" #include <vector> #include <unordered_map> #include <libxml2/libxml/parser.h> namespace swift { namespace obfuscation { enum TargetRuntime { Undefined, CocoaTouch, Cocoa }; enum TraversalDirection { Up, Down }; struct LayoutNodeRenaming { xmlNode *Node; const xmlChar* PropertyName; const std::string ObfuscatedName; LayoutNodeRenaming() = default; LayoutNodeRenaming(xmlNode* Node, const xmlChar* PropertyName, const std::string ObfuscatedName); }; /// Base class for renaming strategies. If a new layout file appears then /// a new strategy should be created and applied to that new type of file. /// Old files should use old strategies to ensure compatibility. class BaseLayoutRenamingStrategy { protected: xmlNode *RootNode; /// Searches for a Node in the xml document starting from a given Node. /// /// \param Node a node where the search begins. /// \param AttributeName name of the attribute /// that the searched node should have. /// \param AttributeValue value of the attribute /// that the searched node should have. /// \param TraversalDirection which direction should /// the document be traversed in - Up or Down. /// /// \returns a Node if it exists or nullptr if not. xmlNode* findNodeWithAttributeValue( xmlNode *Node, const xmlChar *AttributeName, const xmlChar *AttributeValue, const TraversalDirection TraversalDirection); public: virtual void extractLayoutRenamingNodes( xmlNode *Node, const std::vector<SymbolRenaming> &RenamedSymbols, std::vector<LayoutNodeRenaming> &NodesToRename) = 0; virtual llvm::Optional<LayoutNodeRenaming> extractCustomClassRenamingNode( xmlNode *Node, const std::vector<SymbolRenaming> &RenamedSymbols) = 0; virtual llvm::Optional<LayoutNodeRenaming> extractActionRenamingNode( xmlNode *Node, const std::vector<SymbolRenaming> &RenamedSymbols) = 0; virtual llvm::Optional<LayoutNodeRenaming> extractOutletRenamingNode( xmlNode *Node, const std::vector<SymbolRenaming> &RenamedSymbols) = 0; BaseLayoutRenamingStrategy(xmlNode *RootNode); virtual ~BaseLayoutRenamingStrategy() = default; }; class LayoutRenamer { private: std::string FileName; xmlDoc *XmlDocument; llvm::Expected<std::unique_ptr<BaseLayoutRenamingStrategy>> createRenamingStrategy(xmlNode *RootNode); public: LayoutRenamer(std::string FileName); /// Extracts node info required for renaming of layout /// (.xib and .storyboard) files from FilesJson in the following steps: /// /// 1. Gathers all renamed symbols (see Renaming.h) /// and stores them in RenamedSymbols vector. /// 2. Iterates through FilesJson.LayoutFiles list /// and picks renaming strategy based on file type and version. /// 3. Extracts all node info that should be renamed. /// 3. Performs actual renaming. /// 4. Saves renamed layout files in OutputPath. /// /// Typical usage: /// \code /// LayoutRenamer LayoutRenamer(LayoutFile); // param is a path to layout file /// /// // Extract nodes /// auto NodesToRenameOrError /// = LayoutRenamer.extractLayoutRenamingNodes(RenamedSymbols); /// /// if (auto Error = NodesToRenameOrError.takeError()) { /// return std::move(Error); /// } /// /// auto NodesToRename = NodesToRenameOrError.get(); /// /// // Perform renaming on extracted nodes /// if (!NodesToRename.empty()) { /// LayoutRenamer.performRenaming(NodesToRename, Path); /// } /// /// \endcode /// /// \param RenamedSymbols a vector containing all renamed symbols /// in the source code. /// /// \returns a vector containing all node info required to preform renaming. llvm::Expected<std::vector<LayoutNodeRenaming>> extractLayoutRenamingNodes(std::vector<SymbolRenaming> RenamedSymbols); /// Performs actual renaming of layout files /// \param LayoutNodesToRename a vector containing all node info /// required to preform renaming. /// \param OutputPath Path where layout files will be saved after renaming. void performRenaming( const std::vector<LayoutNodeRenaming> LayoutNodesToRename, std::string OutputPath); ~LayoutRenamer(); }; } //namespace obfuscation } //namespace swift #endif /* LayoutRenamer_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/posix/MainLoopPosix.h
//===-- MainLoopPosix.h -----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef lldb_Host_posix_MainLoopPosix_h_ #define lldb_Host_posix_MainLoopPosix_h_ #include "lldb/Host/MainLoopBase.h" #include "llvm/ADT/DenseMap.h" namespace lldb_private { // Posix implementation of the MainLoopBase class. It can monitor file // descriptors for // readability using pselect. In addition to the common base, this class // provides the ability to // invoke a given handler when a signal is received. // // Since this class is primarily intended to be used for single-threaded // processing, it does not // attempt to perform any internal synchronisation and any concurrent accesses // must be protected // externally. However, it is perfectly legitimate to have more than one // instance of this class // running on separate threads, or even a single thread (with some limitations // on signal // monitoring). // TODO: Add locking if this class is to be used in a multi-threaded context. class MainLoopPosix : public MainLoopBase { private: class SignalHandle; public: typedef std::unique_ptr<SignalHandle> SignalHandleUP; ~MainLoopPosix() override; ReadHandleUP RegisterReadObject(const lldb::IOObjectSP &object_sp, const Callback &callback, Error &error) override; // Listening for signals from multiple MainLoopPosix instances is perfectly // safe as long as they // don't try to listen for the same signal. The callback function is invoked // when the control // returns to the Run() function, not when the hander is executed. This means // that you can // treat the callback as a normal function and perform things which would not // be safe in a // signal handler. However, since the callback is not invoked synchronously, // you cannot use // this mechanism to handle SIGSEGV and the like. SignalHandleUP RegisterSignal(int signo, const Callback &callback, Error &error); Error Run() override; // This should only be performed from a callback. Do not attempt to terminate // the processing // from another thread. // TODO: Add synchronization if we want to be terminated from another thread. void RequestTermination() override { m_terminate_request = true; } protected: void UnregisterReadObject(IOObject::WaitableHandle handle) override; void UnregisterSignal(int signo); private: class SignalHandle { public: ~SignalHandle() { m_mainloop.UnregisterSignal(m_signo); } private: SignalHandle(MainLoopPosix &mainloop, int signo) : m_mainloop(mainloop), m_signo(signo) {} MainLoopPosix &m_mainloop; int m_signo; friend class MainLoopPosix; DISALLOW_COPY_AND_ASSIGN(SignalHandle); }; struct SignalInfo { Callback callback; struct sigaction old_action; bool was_blocked : 1; }; llvm::DenseMap<IOObject::WaitableHandle, Callback> m_read_fds; llvm::DenseMap<int, SignalInfo> m_signals; bool m_terminate_request : 1; }; } // namespace lldb_private #endif // lldb_Host_posix_MainLoopPosix_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/lang/objc/modules-incomplete/myModule.h
<reponame>Polidea/SiriusObfuscator @import Foundation; #undef MAX @interface MyClass : NSObject { }; -(void)publicMethod; @end
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Interpreter/OptionGroupOutputFile.h
//===-- OptionGroupOutputFile.h ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_OptionGroupOutputFile_h_ #define liblldb_OptionGroupOutputFile_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Interpreter/OptionValueBoolean.h" #include "lldb/Interpreter/OptionValueFileSpec.h" #include "lldb/Interpreter/Options.h" namespace lldb_private { //------------------------------------------------------------------------- // OptionGroupOutputFile //------------------------------------------------------------------------- class OptionGroupOutputFile : public OptionGroup { public: OptionGroupOutputFile(); ~OptionGroupOutputFile() override; llvm::ArrayRef<OptionDefinition> GetDefinitions() override; Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) override; Error SetOptionValue(uint32_t, const char *, ExecutionContext *) = delete; void OptionParsingStarting(ExecutionContext *execution_context) override; const OptionValueFileSpec &GetFile() { return m_file; } const OptionValueBoolean &GetAppend() { return m_append; } bool AnyOptionWasSet() const { return m_file.OptionWasSet() || m_append.OptionWasSet(); } protected: OptionValueFileSpec m_file; OptionValueBoolean m_append; }; } // namespace lldb_private #endif // liblldb_OptionGroupOutputFile_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/Debugger.h
<filename>SymbolExtractorAndRenamer/lldb/include/lldb/Core/Debugger.h //===-- Debugger.h ----------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Debugger_h_ #define liblldb_Debugger_h_ // C Includes #include <stdint.h> // C++ Includes #include <map> #include <memory> #include <mutex> #include <vector> // Other libraries and framework includes // Project includes #include "lldb/Core/Broadcaster.h" #include "lldb/Core/FormatEntity.h" #include "lldb/Core/IOHandler.h" #include "lldb/Core/Listener.h" #include "lldb/Core/SourceManager.h" #include "lldb/Core/UserID.h" #include "lldb/Core/UserSettingsController.h" #include "lldb/Host/HostThread.h" #include "lldb/Host/Terminal.h" #include "lldb/Target/Platform.h" #include "lldb/Target/TargetList.h" #include "lldb/lldb-public.h" namespace llvm { namespace sys { class DynamicLibrary; } // namespace sys } // namespace llvm namespace lldb_private { //---------------------------------------------------------------------- /// @class Debugger Debugger.h "lldb/Core/Debugger.h" /// @brief A class to manage flag bits. /// /// Provides a global root objects for the debugger core. //---------------------------------------------------------------------- class Debugger : public std::enable_shared_from_this<Debugger>, public UserID, public Properties { friend class SourceManager; // For GetSourceFileCache. public: ~Debugger() override; static lldb::DebuggerSP CreateInstance(lldb::LogOutputCallback log_callback = nullptr, void *baton = nullptr); static lldb::TargetSP FindTargetWithProcessID(lldb::pid_t pid); static lldb::TargetSP FindTargetWithProcess(Process *process); static void Initialize(LoadPluginCallbackType load_plugin_callback); static void Terminate(); static void SettingsInitialize(); static void SettingsTerminate(); static void Destroy(lldb::DebuggerSP &debugger_sp); static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id); static lldb::DebuggerSP FindDebuggerWithInstanceName(const ConstString &instance_name); static size_t GetNumDebuggers(); static lldb::DebuggerSP GetDebuggerAtIndex(size_t index); static bool FormatDisassemblerAddress(const FormatEntity::Entry *format, const SymbolContext *sc, const SymbolContext *prev_sc, const ExecutionContext *exe_ctx, const Address *addr, Stream &s); void Clear(); bool GetAsyncExecution(); void SetAsyncExecution(bool async); lldb::StreamFileSP GetInputFile() { return m_input_file_sp; } lldb::StreamFileSP GetOutputFile() { return m_output_file_sp; } lldb::StreamFileSP GetErrorFile() { return m_error_file_sp; } void SetInputFileHandle(FILE *fh, bool tranfer_ownership); void SetOutputFileHandle(FILE *fh, bool tranfer_ownership); void SetErrorFileHandle(FILE *fh, bool tranfer_ownership); void SaveInputTerminalState(); void RestoreInputTerminalState(); lldb::StreamSP GetAsyncOutputStream(); lldb::StreamSP GetAsyncErrorStream(); CommandInterpreter &GetCommandInterpreter() { assert(m_command_interpreter_ap.get()); return *m_command_interpreter_ap; } lldb::ListenerSP GetListener() { return m_listener_sp; } // This returns the Debugger's scratch source manager. It won't be able to // look up files in debug // information, but it can look up files by absolute path and display them to // you. // To get the target's source manager, call GetSourceManager on the target // instead. SourceManager &GetSourceManager(); lldb::TargetSP GetSelectedTarget() { return m_target_list.GetSelectedTarget(); } ExecutionContext GetSelectedExecutionContext(); //------------------------------------------------------------------ /// Get accessor for the target list. /// /// The target list is part of the global debugger object. This /// the single debugger shared instance to control where targets /// get created and to allow for tracking and searching for targets /// based on certain criteria. /// /// @return /// A global shared target list. //------------------------------------------------------------------ TargetList &GetTargetList() { return m_target_list; } PlatformList &GetPlatformList() { return m_platform_list; } void DispatchInputInterrupt(); void DispatchInputEndOfFile(); //------------------------------------------------------------------ // If any of the streams are not set, set them to the in/out/err // stream of the top most input reader to ensure they at least have // something //------------------------------------------------------------------ void AdoptTopIOHandlerFilesIfInvalid(lldb::StreamFileSP &in, lldb::StreamFileSP &out, lldb::StreamFileSP &err); void PushIOHandler(const lldb::IOHandlerSP &reader_sp); bool PopIOHandler(const lldb::IOHandlerSP &reader_sp); uint32_t PopIOHandlers(const lldb::IOHandlerSP &reader1_sp, const lldb::IOHandlerSP &reader2_sp); // Synchronously run an input reader until it is done void RunIOHandler(const lldb::IOHandlerSP &reader_sp); bool IsTopIOHandler(const lldb::IOHandlerSP &reader_sp); bool CheckTopIOHandlerTypes(IOHandler::Type top_type, IOHandler::Type second_top_type); void PrintAsync(const char *s, size_t len, bool is_stdout); ConstString GetTopIOHandlerControlSequence(char ch); const char *GetIOHandlerCommandPrefix(); const char *GetIOHandlerHelpPrologue(); void ClearIOHandlers(); bool GetCloseInputOnEOF() const; void SetCloseInputOnEOF(bool b); bool EnableLog(const char *channel, const char **categories, const char *log_file, uint32_t log_options, Stream &error_stream); void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton); //---------------------------------------------------------------------- // Properties Functions //---------------------------------------------------------------------- enum StopDisassemblyType { eStopDisassemblyTypeNever = 0, eStopDisassemblyTypeNoDebugInfo, eStopDisassemblyTypeNoSource, eStopDisassemblyTypeAlways }; Error SetPropertyValue(const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef property_path, llvm::StringRef value) override; bool GetAutoConfirm() const; const FormatEntity::Entry *GetDisassemblyFormat() const; const FormatEntity::Entry *GetFrameFormat() const; const FormatEntity::Entry *GetThreadFormat() const; const FormatEntity::Entry *GetThreadStopFormat() const; lldb::ScriptLanguage GetScriptLanguage() const; bool SetScriptLanguage(lldb::ScriptLanguage script_lang); uint32_t GetTerminalWidth() const; bool SetTerminalWidth(uint32_t term_width); llvm::StringRef GetPrompt() const; void SetPrompt(llvm::StringRef p); void SetPrompt(const char *) = delete; bool GetUseExternalEditor() const; bool SetUseExternalEditor(bool use_external_editor_p); bool GetUseColor() const; bool SetUseColor(bool use_color); lldb::StopShowColumn GetStopShowColumn() const; const FormatEntity::Entry *GetStopShowColumnAnsiPrefix() const; const FormatEntity::Entry *GetStopShowColumnAnsiSuffix() const; uint32_t GetStopSourceLineCount(bool before) const; StopDisassemblyType GetStopDisassemblyDisplay() const; uint32_t GetDisassemblyLineCount() const; bool GetAutoOneLineSummaries() const; bool GetAutoIndent() const; bool SetAutoIndent(bool b); bool GetPrintDecls() const; bool SetPrintDecls(bool b); uint32_t GetTabSize() const; bool SetTabSize(uint32_t tab_size); bool GetEscapeNonPrintables() const; bool GetNotifyVoid() const; const ConstString &GetInstanceName() { return m_instance_name; } bool LoadPlugin(const FileSpec &spec, Error &error); void ExecuteIOHandlers(); bool IsForwardingEvents(); void EnableForwardEvents(const lldb::ListenerSP &listener_sp); void CancelForwardEvents(const lldb::ListenerSP &listener_sp); bool IsHandlingEvents() const { return m_event_handler_thread.IsJoinable(); } Error RunREPL(lldb::LanguageType language, const char *repl_options); bool REPLIsActive() { return m_input_reader_stack.REPLIsActive(); } bool REPLIsEnabled() { return m_input_reader_stack.REPLIsEnabled(); } // This is for use in the command interpreter, when you either want the // selected target, or if no target // is present you want to prime the dummy target with entities that will be // copied over to new targets. Target *GetSelectedOrDummyTarget(bool prefer_dummy = false); Target *GetDummyTarget(); lldb::BroadcasterManagerSP GetBroadcasterManager() { return m_broadcaster_manager_sp; } protected: friend class CommandInterpreter; friend class SwiftREPL; friend class REPL; bool StartEventHandlerThread(); void StopEventHandlerThread(); static lldb::thread_result_t EventHandlerThread(lldb::thread_arg_t arg); bool HasIOHandlerThread(); bool StartIOHandlerThread(); void StopIOHandlerThread(); void JoinIOHandlerThread(); static lldb::thread_result_t IOHandlerThread(lldb::thread_arg_t arg); void DefaultEventHandler(); void HandleBreakpointEvent(const lldb::EventSP &event_sp); void HandleProcessEvent(const lldb::EventSP &event_sp); void HandleThreadEvent(const lldb::EventSP &event_sp); size_t GetProcessSTDOUT(Process *process, Stream *stream); size_t GetProcessSTDERR(Process *process, Stream *stream); SourceManager::SourceFileCache &GetSourceFileCache() { return m_source_file_cache; } void InstanceInitialize(); lldb::StreamFileSP m_input_file_sp; lldb::StreamFileSP m_output_file_sp; lldb::StreamFileSP m_error_file_sp; lldb::BroadcasterManagerSP m_broadcaster_manager_sp; // The debugger acts as a // broadcaster manager of // last resort. // It needs to get constructed before the target_list or any other // member that might want to broadcast through the debugger. TerminalState m_terminal_state; TargetList m_target_list; PlatformList m_platform_list; lldb::ListenerSP m_listener_sp; std::unique_ptr<SourceManager> m_source_manager_ap; // This is a scratch // source manager that we // return if we have no // targets. SourceManager::SourceFileCache m_source_file_cache; // All the source managers // for targets created in // this debugger used this // shared // source file cache. std::unique_ptr<CommandInterpreter> m_command_interpreter_ap; IOHandlerStack m_input_reader_stack; typedef std::map<std::string, lldb::StreamWP> LogStreamMap; LogStreamMap m_log_streams; lldb::StreamSP m_log_callback_stream_sp; ConstString m_instance_name; static LoadPluginCallbackType g_load_plugin_callback; typedef std::vector<llvm::sys::DynamicLibrary> LoadedPluginsList; LoadedPluginsList m_loaded_plugins; HostThread m_event_handler_thread; HostThread m_io_handler_thread; Broadcaster m_sync_broadcaster; lldb::ListenerSP m_forward_listener_sp; std::once_flag m_clear_once; //---------------------------------------------------------------------- // Events for m_sync_broadcaster //---------------------------------------------------------------------- enum { eBroadcastBitEventThreadIsListening = (1 << 0), }; private: // Use Debugger::CreateInstance() to get a shared pointer to a new // debugger object Debugger(lldb::LogOutputCallback m_log_callback, void *baton); DISALLOW_COPY_AND_ASSIGN(Debugger); }; } // namespace lldb_private #endif // liblldb_Debugger_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Symbol/CompilerDecl.h
<reponame>Polidea/SiriusObfuscator //===-- CompilerDecl.h ------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_CompilerDecl_h_ #define liblldb_CompilerDecl_h_ #include "lldb/Core/ConstString.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/lldb-private.h" namespace lldb_private { class CompilerDecl { public: //---------------------------------------------------------------------- // Constructors and Destructors //---------------------------------------------------------------------- CompilerDecl() : m_type_system(nullptr), m_opaque_decl(nullptr) {} CompilerDecl(TypeSystem *type_system, void *decl) : m_type_system(type_system), m_opaque_decl(decl) {} ~CompilerDecl() {} //---------------------------------------------------------------------- // Tests //---------------------------------------------------------------------- explicit operator bool() const { return IsValid(); } bool operator<(const CompilerDecl &rhs) const { if (m_type_system == rhs.m_type_system) return m_opaque_decl < rhs.m_opaque_decl; return m_type_system < rhs.m_type_system; } bool IsValid() const { return m_type_system != nullptr && m_opaque_decl != nullptr; } bool IsClang() const; //---------------------------------------------------------------------- // Accessors //---------------------------------------------------------------------- TypeSystem *GetTypeSystem() const { return m_type_system; } void *GetOpaqueDecl() const { return m_opaque_decl; } void SetDecl(TypeSystem *type_system, void *decl) { m_type_system = type_system; m_opaque_decl = decl; } void Clear() { m_type_system = nullptr; m_opaque_decl = nullptr; } ConstString GetName() const; ConstString GetMangledName() const; CompilerDeclContext GetDeclContext() const; // If this decl represents a function, return the return type CompilerType GetFunctionReturnType() const; // If this decl represents a function, return the number of arguments for the // function size_t GetNumFunctionArguments() const; // If this decl represents a function, return the argument type given a zero // based argument index CompilerType GetFunctionArgumentType(size_t arg_idx) const; private: TypeSystem *m_type_system; void *m_opaque_decl; }; bool operator==(const CompilerDecl &lhs, const CompilerDecl &rhs); bool operator!=(const CompilerDecl &lhs, const CompilerDecl &rhs); } // namespace lldb_private #endif // #ifndef liblldb_CompilerDecl_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Analysis/valist-as-lazycompound.c
// RUN: %clang_cc1 -triple gcc-linaro-arm-linux-gnueabihf -analyze -analyzer-checker=core,valist.Uninitialized,valist.CopyToSelf -analyzer-output=text -analyzer-store=region -verify %s // expected-no-diagnostics typedef unsigned int size_t; typedef __builtin_va_list __gnuc_va_list; typedef __gnuc_va_list va_list; extern int vsprintf(char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg); void _dprintf(const char *function, int flen, int line, int level, const char *prefix, const char *fmt, ...) { char raw[10]; int err; va_list ap; __builtin_va_start(ap, fmt); err = vsprintf(raw, fmt, ap); __builtin_va_end(ap); }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Index/Store/syntax-only.c
<filename>SymbolExtractorAndRenamer/clang/test/Index/Store/syntax-only.c<gh_stars>100-1000 // RUN: rm -rf %t.idx // RUN: %clang -fsyntax-only %s -index-store-path %t.idx -o %T/syntax-only.c.myoutfile // RUN: c-index-test core -print-unit %t.idx | FileCheck %s -check-prefix=CHECK-UNIT // RUN: c-index-test core -print-record %t.idx | FileCheck %s -check-prefix=CHECK-RECORD // XFAIL: linux // CHECK-UNIT: out-file: {{.*}}/syntax-only.c.myoutfile // CHECK-RECORD: function/C | foo | c:@F@foo void foo();
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/cmark/src/node.h
<reponame>Polidea/SiriusObfuscator #ifndef CMARK_NODE_H #define CMARK_NODE_H #ifdef __cplusplus extern "C" { #endif #include <stdio.h> #include <stdint.h> #include "cmark.h" #include "buffer.h" #include "chunk.h" typedef struct { cmark_list_type list_type; int marker_offset; int padding; int start; cmark_delim_type delimiter; unsigned char bullet_char; bool tight; } cmark_list; typedef struct { cmark_chunk info; cmark_chunk literal; int fence_length; /* fence_offset must be 0-3, so we can use int8_t */ int8_t fence_offset; unsigned char fence_char; bool fenced; } cmark_code; typedef struct { int level; bool setext; } cmark_header; typedef struct { cmark_chunk url; cmark_chunk title; } cmark_link; struct cmark_node { struct cmark_node *next; struct cmark_node *prev; struct cmark_node *parent; struct cmark_node *first_child; struct cmark_node *last_child; void *user_data; int start_line; int start_column; int end_line; int end_column; cmark_node_type type; bool open; bool last_line_blank; cmark_strbuf string_content; union { cmark_chunk literal; cmark_list list; cmark_code code; cmark_header header; cmark_link link; int html_block_type; } as; }; CMARK_EXPORT int cmark_node_check(cmark_node *node, FILE *out); #ifdef __cplusplus } #endif #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/lib/Index/FileIndexRecord.h
<gh_stars>100-1000 //===--- FileIndexRecord.h - Index data per file --------------------------===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_LIB_INDEX_FILEINDEXRECORD_H #define LLVM_CLANG_LIB_INDEX_FILEINDEXRECORD_H #include "clang/Index/IndexSymbol.h" #include "clang/Basic/SourceLocation.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/SmallVector.h" #include <vector> namespace clang { class IdentifierInfo; namespace index { class FileIndexRecord { public: struct DeclOccurrence { SymbolRoleSet Roles; unsigned Offset; const Decl *Dcl; SmallVector<SymbolRelation, 3> Relations; DeclOccurrence(SymbolRoleSet R, unsigned Offset, const Decl *D, ArrayRef<SymbolRelation> Relations) : Roles(R), Offset(Offset), Dcl(D), Relations(Relations.begin(), Relations.end()) {} friend bool operator <(const DeclOccurrence &LHS, const DeclOccurrence &RHS) { return LHS.Offset < RHS.Offset; } }; private: FileID FID; bool IsSystem; std::vector<DeclOccurrence> Decls; public: FileIndexRecord(FileID FID, bool isSystem) : FID(FID), IsSystem(isSystem) {} ArrayRef<DeclOccurrence> getDeclOccurrences() const { return Decls; } FileID getFileID() const { return FID; } bool isSystem() const { return IsSystem; } void addDeclOccurence(SymbolRoleSet Roles, unsigned Offset, const Decl *D, ArrayRef<SymbolRelation> Relations); void print(llvm::raw_ostream &OS); }; } // end namespace index } // end namespace clang #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/Excluder.h
#ifndef Excluder_h #define Excluder_h #include "swift/Obfuscation/DataStructures.h" #include "swift/Obfuscation/Extractor.h" namespace swift { namespace obfuscation { class Excluder { public: virtual llvm::Optional<DeclWithSymbolWithRange> symbolsToExclude(DeclWithSymbolWithRange &DeclAndSymbolWithRange) = 0; virtual ~Excluder() = default; }; class ConfigurationExcluder: public Excluder { private: ObfuscationConfiguration Configuration; NominalTypeExtractor &NominalTypeExtractor; bool shouldExclude(Decl *Declaration, const std::pair<const ClassDecl *, std::string> &DeclarationAndModule, const InheritanceExclusion *ExcludedType); bool handleTypeExclusion(const TypeExclusion *Exclusion, Decl *Declaration); bool handleInheritanceExclusion(const InheritanceExclusion *Exclusion, Decl *Declaration); bool handleConformanceExclusion(const ConformanceExclusion *Exclusion, Decl *Declaration); public: ConfigurationExcluder(ObfuscationConfiguration &&, class NominalTypeExtractor &); llvm::Optional<DeclWithSymbolWithRange> symbolsToExclude(DeclWithSymbolWithRange &DeclAndSymbolWithRange) override; }; class NSManagedExcluder: public Excluder { public: llvm::Optional<DeclWithSymbolWithRange> symbolsToExclude(DeclWithSymbolWithRange &DeclAndSymbolWithRange) override; }; } //namespace obfuscation } //namespace swift #endif /* Excluder_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c
<reponame>Polidea/SiriusObfuscator<filename>SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/functionalities/register/intel_avx/main.c //===-- main.c ------------------------------------------------*- C -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// void func() { unsigned int ymmvalues[16]; unsigned char val; unsigned char i; for (i = 0 ; i < 16 ; i++) { val = (0x80 | i); ymmvalues[i] = (val << 24) | (val << 16) | (val << 8) | val; } unsigned int ymmallones = 0xFFFFFFFF; __asm__("int3;" "vbroadcastss %1, %%ymm0;" "vbroadcastss %0, %%ymm0;" "vbroadcastss %2, %%ymm1;" "vbroadcastss %0, %%ymm1;" "vbroadcastss %3, %%ymm2;" "vbroadcastss %0, %%ymm2;" "vbroadcastss %4, %%ymm3;" "vbroadcastss %0, %%ymm3;" "vbroadcastss %5, %%ymm4;" "vbroadcastss %0, %%ymm4;" "vbroadcastss %6, %%ymm5;" "vbroadcastss %0, %%ymm5;" "vbroadcastss %7, %%ymm6;" "vbroadcastss %0, %%ymm6;" "vbroadcastss %8, %%ymm7;" "vbroadcastss %0, %%ymm7;" #if defined(__x86_64__) "vbroadcastss %9, %%ymm8;" "vbroadcastss %0, %%ymm8;" "vbroadcastss %10, %%ymm9;" "vbroadcastss %0, %%ymm9;" "vbroadcastss %11, %%ymm10;" "vbroadcastss %0, %%ymm10;" "vbroadcastss %12, %%ymm11;" "vbroadcastss %0, %%ymm11;" "vbroadcastss %13, %%ymm12;" "vbroadcastss %0, %%ymm12;" "vbroadcastss %14, %%ymm13;" "vbroadcastss %0, %%ymm13;" "vbroadcastss %15, %%ymm14;" "vbroadcastss %0, %%ymm14;" "vbroadcastss %16, %%ymm15;" "vbroadcastss %0, %%ymm15;" #endif ::"m"(ymmallones), "m"(ymmvalues[0]), "m"(ymmvalues[1]), "m"(ymmvalues[2]), "m"(ymmvalues[3]), "m"(ymmvalues[4]), "m"(ymmvalues[5]), "m"(ymmvalues[6]), "m"(ymmvalues[7]) #if defined(__x86_64__) , "m"(ymmvalues[8]), "m"(ymmvalues[9]), "m"(ymmvalues[10]), "m"(ymmvalues[11]), "m"(ymmvalues[12]), "m"(ymmvalues[13]), "m"(ymmvalues[14]), "m"(ymmvalues[15]) #endif ); } int main(int argc, char const *argv[]) { func(); }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/llvm/include/llvm/Transforms/IPO/FunctionImport.h
//===- llvm/Transforms/IPO/FunctionImport.h - ThinLTO importing -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef LLVM_FUNCTIONIMPORT_H #define LLVM_FUNCTIONIMPORT_H #include "llvm/ADT/StringMap.h" #include "llvm/IR/GlobalValue.h" #include "llvm/IR/ModuleSummaryIndex.h" #include "llvm/IR/PassManager.h" #include "llvm/Support/Error.h" #include <functional> #include <map> #include <unordered_set> #include <utility> namespace llvm { class LLVMContext; class GlobalValueSummary; class Module; /// The function importer is automatically importing function from other modules /// based on the provided summary informations. class FunctionImporter { public: /// Set of functions to import from a source module. Each entry is a map /// containing all the functions to import for a source module. /// The keys is the GUID identifying a function to import, and the value /// is the threshold applied when deciding to import it. typedef std::map<GlobalValue::GUID, unsigned> FunctionsToImportTy; /// The map contains an entry for every module to import from, the key being /// the module identifier to pass to the ModuleLoader. The value is the set of /// functions to import. typedef StringMap<FunctionsToImportTy> ImportMapTy; /// The set contains an entry for every global value the module exports. typedef std::unordered_set<GlobalValue::GUID> ExportSetTy; /// A function of this type is used to load modules referenced by the index. typedef std::function<Expected<std::unique_ptr<Module>>(StringRef Identifier)> ModuleLoaderTy; /// Create a Function Importer. FunctionImporter(const ModuleSummaryIndex &Index, ModuleLoaderTy ModuleLoader) : Index(Index), ModuleLoader(std::move(ModuleLoader)) {} /// Import functions in Module \p M based on the supplied import list. Expected<bool> importFunctions(Module &M, const ImportMapTy &ImportList); private: /// The summaries index used to trigger importing. const ModuleSummaryIndex &Index; /// Factory function to load a Module for a given identifier ModuleLoaderTy ModuleLoader; }; /// The function importing pass class FunctionImportPass : public PassInfoMixin<FunctionImportPass> { public: PreservedAnalyses run(Module &M, ModuleAnalysisManager &AM); }; /// Compute all the imports and exports for every module in the Index. /// /// \p ModuleToDefinedGVSummaries contains for each Module a map /// (GUID -> Summary) for every global defined in the module. /// /// \p ImportLists will be populated with an entry for every Module we are /// importing into. This entry is itself a map that can be passed to /// FunctionImporter::importFunctions() above (see description there). /// /// \p ExportLists contains for each Module the set of globals (GUID) that will /// be imported by another module, or referenced by such a function. I.e. this /// is the set of globals that need to be promoted/renamed appropriately. /// /// \p DeadSymbols (optional) contains a list of GUID that are deemed "dead" and /// will be ignored for the purpose of importing. void ComputeCrossModuleImport( const ModuleSummaryIndex &Index, const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries, StringMap<FunctionImporter::ImportMapTy> &ImportLists, StringMap<FunctionImporter::ExportSetTy> &ExportLists, const DenseSet<GlobalValue::GUID> *DeadSymbols = nullptr); /// Compute all the imports for the given module using the Index. /// /// \p ImportList will be populated with a map that can be passed to /// FunctionImporter::importFunctions() above (see description there). void ComputeCrossModuleImportForModule( StringRef ModulePath, const ModuleSummaryIndex &Index, FunctionImporter::ImportMapTy &ImportList); /// Compute all the symbols that are "dead": i.e these that can't be reached /// in the graph from any of the given symbols listed in /// \p GUIDPreservedSymbols. DenseSet<GlobalValue::GUID> computeDeadSymbols(const ModuleSummaryIndex &Index, const DenseSet<GlobalValue::GUID> &GUIDPreservedSymbols); /// Compute the set of summaries needed for a ThinLTO backend compilation of /// \p ModulePath. // /// This includes summaries from that module (in case any global summary based /// optimizations were recorded) and from any definitions in other modules that /// should be imported. // /// \p ModuleToSummariesForIndex will be populated with the needed summaries /// from each required module path. Use a std::map instead of StringMap to get /// stable order for bitcode emission. void gatherImportedSummariesForModule( StringRef ModulePath, const StringMap<GVSummaryMapTy> &ModuleToDefinedGVSummaries, const FunctionImporter::ImportMapTy &ImportList, std::map<std::string, GVSummaryMapTy> &ModuleToSummariesForIndex); /// Emit into \p OutputFilename the files module \p ModulePath will import from. std::error_code EmitImportsFiles(StringRef ModulePath, StringRef OutputFilename, const FunctionImporter::ImportMapTy &ModuleImports); /// Resolve WeakForLinker values in \p TheModule based on the information /// recorded in the summaries during global summary-based analysis. void thinLTOResolveWeakForLinkerModule(Module &TheModule, const GVSummaryMapTy &DefinedGlobals); /// Internalize \p TheModule based on the information recorded in the summaries /// during global summary-based analysis. void thinLTOInternalizeModule(Module &TheModule, const GVSummaryMapTy &DefinedGlobals); } #endif // LLVM_FUNCTIONIMPORT_H
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/FileSystem.h
//===-- FileSystem.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Host_FileSystem_h #define liblldb_Host_FileSystem_h #include "lldb/Core/Error.h" #include "lldb/Host/FileSpec.h" #include "llvm/Support/Chrono.h" #include "lldb/lldb-types.h" #include <stdint.h> #include <stdio.h> #include <sys/stat.h> namespace lldb_private { class FileSystem { public: static const char *DEV_NULL; static const char *PATH_CONVERSION_ERROR; static FileSpec::PathSyntax GetNativePathSyntax(); static Error MakeDirectory(const FileSpec &file_spec, uint32_t mode); static Error DeleteDirectory(const FileSpec &file_spec, bool recurse); static Error GetFilePermissions(const FileSpec &file_spec, uint32_t &file_permissions); static Error SetFilePermissions(const FileSpec &file_spec, uint32_t file_permissions); static lldb::user_id_t GetFileSize(const FileSpec &file_spec); static bool GetFileExists(const FileSpec &file_spec); static Error Hardlink(const FileSpec &src, const FileSpec &dst); static int GetHardlinkCount(const FileSpec &file_spec); static Error Symlink(const FileSpec &src, const FileSpec &dst); static Error Readlink(const FileSpec &src, FileSpec &dst); static Error Unlink(const FileSpec &file_spec); static Error ResolveSymbolicLink(const FileSpec &src, FileSpec &dst); static bool CalculateMD5(const FileSpec &file_spec, uint64_t &low, uint64_t &high); static bool CalculateMD5(const FileSpec &file_spec, uint64_t offset, uint64_t length, uint64_t &low, uint64_t &high); static bool CalculateMD5AsString(const FileSpec &file_spec, std::string &digest_str); static bool CalculateMD5AsString(const FileSpec &file_spec, uint64_t offset, uint64_t length, std::string &digest_str); /// Return \b true if \a spec is on a locally mounted file system, \b false /// otherwise. static bool IsLocal(const FileSpec &spec); /// Wraps ::fopen in a platform-independent way. Once opened, FILEs can be /// manipulated and closed with the normal ::fread, ::fclose, etc. functions. static FILE *Fopen(const char *path, const char *mode); /// Wraps ::stat in a platform-independent way. static int Stat(const char *path, struct stat *stats); static llvm::sys::TimePoint<> GetModificationTime(const FileSpec &file_spec); }; } #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Symbol/Declaration.h
//===-- Declaration.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Declaration_h_ #define liblldb_Declaration_h_ #include "lldb/Host/FileSpec.h" #include "lldb/lldb-private.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class Declaration Declaration.h "lldb/Symbol/Declaration.h" /// @brief A class that describes the declaration location of a /// lldb object. /// /// The declarations include the file specification, line number, and /// the column info and can help track where functions, blocks, inlined /// functions, types, variables, any many other debug core objects were /// declared. //---------------------------------------------------------------------- class Declaration { public: //------------------------------------------------------------------ /// Default constructor. //------------------------------------------------------------------ Declaration() : m_file(), m_line(0) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS , m_column(0) #endif { } //------------------------------------------------------------------ /// Construct with file specification, and optional line and column. /// /// @param[in] file_spec /// The file specification that describes where this was /// declared. /// /// @param[in] line /// The line number that describes where this was declared. Set /// to zero if there is no line number information. /// /// @param[in] column /// The column number that describes where this was declared. /// Set to zero if there is no column number information. //------------------------------------------------------------------ Declaration(const FileSpec &file_spec, uint32_t line = 0, uint32_t column = 0) : m_file(file_spec), m_line(line) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS , m_column(column) #endif { } //------------------------------------------------------------------ /// Construct with a reference to another Declaration object. //------------------------------------------------------------------ Declaration(const Declaration &rhs) : m_file(rhs.m_file), m_line(rhs.m_line) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS , m_column(rhs.m_column) #endif { } //------------------------------------------------------------------ /// Construct with a pointer to another Declaration object. //------------------------------------------------------------------ Declaration(const Declaration *decl_ptr) : m_file(), m_line(0) #ifdef LLDB_ENABLE_DECLARATION_COLUMNS , m_column(0) #endif { if (decl_ptr) *this = *decl_ptr; } //------------------------------------------------------------------ /// Clear the object's state. /// /// Sets the file specification to be empty, and the line and column /// to zero. //------------------------------------------------------------------ void Clear() { m_file.Clear(); m_line = 0; #ifdef LLDB_ENABLE_DECLARATION_COLUMNS m_column = 0; #endif } //------------------------------------------------------------------ /// Compare two declaration objects. /// /// Compares the two file specifications from \a lhs and \a rhs. If /// the file specifications are equal, then continue to compare the /// line number and column numbers respectively. /// /// @param[in] lhs /// The Left Hand Side const Declaration object reference. /// /// @param[in] rhs /// The Right Hand Side const Declaration object reference. /// /// @return /// @li -1 if lhs < rhs /// @li 0 if lhs == rhs /// @li 1 if lhs > rhs //------------------------------------------------------------------ static int Compare(const Declaration &lhs, const Declaration &rhs); //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the /// supplied stream \a s. /// /// @param[in] s /// The stream to which to dump the object description. //------------------------------------------------------------------ void Dump(Stream *s, bool show_fullpaths) const; bool DumpStopContext(Stream *s, bool show_fullpaths) const; //------------------------------------------------------------------ /// Get accessor for the declaration column number. /// /// @return /// Non-zero indicates a valid column number, zero indicates no /// column information is available. //------------------------------------------------------------------ uint32_t GetColumn() const { #ifdef LLDB_ENABLE_DECLARATION_COLUMNS return m_column; #else return 0; #endif } //------------------------------------------------------------------ /// Get accessor for file specification. /// /// @return /// A reference to the file specification object. //------------------------------------------------------------------ FileSpec &GetFile() { return m_file; } //------------------------------------------------------------------ /// Get const accessor for file specification. /// /// @return /// A const reference to the file specification object. //------------------------------------------------------------------ const FileSpec &GetFile() const { return m_file; } //------------------------------------------------------------------ /// Get accessor for the declaration line number. /// /// @return /// Non-zero indicates a valid line number, zero indicates no /// line information is available. //------------------------------------------------------------------ uint32_t GetLine() const { return m_line; } bool IsValid() const { return m_file && m_line != 0; } //------------------------------------------------------------------ /// Get the memory cost of this object. /// /// @return /// The number of bytes that this object occupies in memory. /// The returned value does not include the bytes for any /// shared string values. /// /// @see ConstString::StaticMemorySize () //------------------------------------------------------------------ size_t MemorySize() const; //------------------------------------------------------------------ /// Set accessor for the declaration column number. /// /// @param[in] column /// Non-zero indicates a valid column number, zero indicates no /// column information is available. //------------------------------------------------------------------ void SetColumn(uint32_t column) { #ifdef LLDB_ENABLE_DECLARATION_COLUMNS m_column = col; #endif } //------------------------------------------------------------------ /// Set accessor for the declaration file specification. /// /// @param[in] file_spec /// The new declaration file specification. //------------------------------------------------------------------ void SetFile(const FileSpec &file_spec) { m_file = file_spec; } //------------------------------------------------------------------ /// Set accessor for the declaration line number. /// /// @param[in] line /// Non-zero indicates a valid line number, zero indicates no /// line information is available. //------------------------------------------------------------------ void SetLine(uint32_t line) { m_line = line; } protected: //------------------------------------------------------------------ /// Member variables. //------------------------------------------------------------------ FileSpec m_file; ///< The file specification that points to the ///< source file where the declaration occurred. uint32_t m_line; ///< Non-zero values indicates a valid line number, ///< zero indicates no line number information is available. #ifdef LLDB_ENABLE_DECLARATION_COLUMNS uint32_t m_column; ///< Non-zero values indicates a valid column number, ///< zero indicates no column information is available. #endif }; bool operator==(const Declaration &lhs, const Declaration &rhs); } // namespace lldb_private #endif // liblldb_Declaration_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVMC.h
//===-- DisassemblerLLVMC.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_DisassemblerLLVMC_h_ #define liblldb_DisassemblerLLVMC_h_ // C Includes // C++ Includes #include <memory> #include <mutex> #include <string> // Other libraries and framework includes #include "llvm-c/Disassembler.h" // Project includes #include "lldb/Core/Address.h" #include "lldb/Core/Disassembler.h" #include "lldb/Core/PluginManager.h" // Opaque references to C++ Objects in LLVM's MC. namespace llvm { class MCContext; class MCInst; class MCInstrInfo; class MCRegisterInfo; class MCDisassembler; class MCInstPrinter; class MCAsmInfo; class MCSubtargetInfo; } // namespace llvm class InstructionLLVMC; class DisassemblerLLVMC : public lldb_private::Disassembler { // Since we need to make two actual MC Disassemblers for ARM (ARM & THUMB), // and there's a bit of goo to set up and own // in the MC disassembler world, I added this class to manage the actual // disassemblers. class LLVMCDisassembler { public: LLVMCDisassembler(const char *triple, const char *cpu, const char *features_str, unsigned flavor, DisassemblerLLVMC &owner); ~LLVMCDisassembler(); uint64_t GetMCInst(const uint8_t *opcode_data, size_t opcode_data_len, lldb::addr_t pc, llvm::MCInst &mc_inst); void PrintMCInst(llvm::MCInst &mc_inst, std::string &inst_string, std::string &comments_string); void SetStyle(bool use_hex_immed, HexImmediateStyle hex_style); bool CanBranch(llvm::MCInst &mc_inst); bool HasDelaySlot(llvm::MCInst &mc_inst); bool IsCall(llvm::MCInst &mc_inst); bool IsValid() { return m_is_valid; } private: bool m_is_valid; std::unique_ptr<llvm::MCContext> m_context_ap; std::unique_ptr<llvm::MCAsmInfo> m_asm_info_ap; std::unique_ptr<llvm::MCSubtargetInfo> m_subtarget_info_ap; std::unique_ptr<llvm::MCInstrInfo> m_instr_info_ap; std::unique_ptr<llvm::MCRegisterInfo> m_reg_info_ap; std::unique_ptr<llvm::MCInstPrinter> m_instr_printer_ap; std::unique_ptr<llvm::MCDisassembler> m_disasm_ap; }; public: DisassemblerLLVMC(const lldb_private::ArchSpec &arch, const char *flavor /* = NULL */); ~DisassemblerLLVMC() override; //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ static void Initialize(); static void Terminate(); static lldb_private::ConstString GetPluginNameStatic(); static lldb_private::Disassembler * CreateInstance(const lldb_private::ArchSpec &arch, const char *flavor); size_t DecodeInstructions(const lldb_private::Address &base_addr, const lldb_private::DataExtractor &data, lldb::offset_t data_offset, size_t num_instructions, bool append, bool data_from_file) override; //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; protected: friend class InstructionLLVMC; bool FlavorValidForArchSpec(const lldb_private::ArchSpec &arch, const char *flavor) override; bool IsValid() { return (m_disasm_ap.get() != NULL && m_disasm_ap->IsValid()); } int OpInfo(uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void *TagBug); const char *SymbolLookup(uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName); static int OpInfoCallback(void *DisInfo, uint64_t PC, uint64_t Offset, uint64_t Size, int TagType, void *TagBug); static const char *SymbolLookupCallback(void *DisInfo, uint64_t ReferenceValue, uint64_t *ReferenceType, uint64_t ReferencePC, const char **ReferenceName); void Lock(InstructionLLVMC *inst, const lldb_private::ExecutionContext *exe_ctx) { m_mutex.lock(); m_inst = inst; m_exe_ctx = exe_ctx; } void Unlock() { m_inst = NULL; m_exe_ctx = NULL; m_mutex.unlock(); } const lldb_private::ExecutionContext *m_exe_ctx; InstructionLLVMC *m_inst; std::mutex m_mutex; bool m_data_from_file; std::unique_ptr<LLVMCDisassembler> m_disasm_ap; std::unique_ptr<LLVMCDisassembler> m_alternate_disasm_ap; }; #endif // liblldb_DisassemblerLLVM_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/include/clang/APINotes/Types.h
//===--- Types.h - API Notes Data Types --------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // This file defines data types used in the representation of API notes data. // //===----------------------------------------------------------------------===// #ifndef LLVM_CLANG_API_NOTES_TYPES_H #define LLVM_CLANG_API_NOTES_TYPES_H #include "clang/Basic/Specifiers.h" #include "llvm/ADT/ArrayRef.h" #include "llvm/ADT/Optional.h" #include "llvm/ADT/StringRef.h" #include <cassert> #include <climits> namespace llvm { class raw_ostream; } namespace clang { namespace api_notes { /// The file extension used for the source representation of API notes. static const char SOURCE_APINOTES_EXTENSION[] = "apinotes"; /// The file extension used for the binary representation of API notes. static const char BINARY_APINOTES_EXTENSION[] = "apinotesc"; using llvm::ArrayRef; using llvm::StringRef; using llvm::Optional; using llvm::None; /// Opaque context ID used to refer to an Objective-C class or protocol. class ContextID { public: unsigned Value; explicit ContextID(unsigned value) : Value(value) { } }; /// Describes API notes data for any entity. /// /// This is used as the base of all API notes. class CommonEntityInfo { public: /// Message to use when this entity is unavailable. std::string UnavailableMsg; /// Whether this entity is marked unavailable. unsigned Unavailable : 1; /// Whether this entity is marked unavailable in Swift. unsigned UnavailableInSwift : 1; private: /// Whether SwiftPrivate was specified. unsigned SwiftPrivateSpecified : 1; /// Whether this entity is considered "private" to a Swift overlay. unsigned SwiftPrivate : 1; public: /// Swift name of this entity. std::string SwiftName; CommonEntityInfo() : Unavailable(0), UnavailableInSwift(0), SwiftPrivateSpecified(0), SwiftPrivate(0) { } Optional<bool> isSwiftPrivate() const { if (!SwiftPrivateSpecified) return None; return SwiftPrivate; } void setSwiftPrivate(Optional<bool> swiftPrivate) { if (swiftPrivate) { SwiftPrivateSpecified = 1; SwiftPrivate = *swiftPrivate; } else { SwiftPrivateSpecified = 0; SwiftPrivate = 0; } } friend bool operator==(const CommonEntityInfo &lhs, const CommonEntityInfo &rhs) { return lhs.UnavailableMsg == rhs.UnavailableMsg && lhs.Unavailable == rhs.Unavailable && lhs.UnavailableInSwift == rhs.UnavailableInSwift && lhs.SwiftPrivateSpecified == rhs.SwiftPrivateSpecified && lhs.SwiftPrivate == rhs.SwiftPrivate && lhs.SwiftName == rhs.SwiftName; } friend bool operator!=(const CommonEntityInfo &lhs, const CommonEntityInfo &rhs) { return !(lhs == rhs); } friend CommonEntityInfo &operator|=(CommonEntityInfo &lhs, const CommonEntityInfo &rhs) { // Merge unavailability. if (rhs.Unavailable) { lhs.Unavailable = true; if (rhs.UnavailableMsg.length() != 0 && lhs.UnavailableMsg.length() == 0) { lhs.UnavailableMsg = rhs.UnavailableMsg; } } if (rhs.UnavailableInSwift) { lhs.UnavailableInSwift = true; if (rhs.UnavailableMsg.length() != 0 && lhs.UnavailableMsg.length() == 0) { lhs.UnavailableMsg = rhs.UnavailableMsg; } } if (rhs.SwiftPrivateSpecified && !lhs.SwiftPrivateSpecified) { lhs.SwiftPrivateSpecified = 1; lhs.SwiftPrivate = rhs.SwiftPrivate; } if (rhs.SwiftName.length() != 0 && lhs.SwiftName.length() == 0) lhs.SwiftName = rhs.SwiftName; return lhs; } }; /// Describes API notes for types. class CommonTypeInfo : public CommonEntityInfo { /// The Swift type to which a given type is bridged. /// /// Reflects the swift_bridge attribute. Optional<std::string> SwiftBridge; /// The NS error domain for this type. Optional<std::string> NSErrorDomain; public: CommonTypeInfo() : CommonEntityInfo() { } const Optional<std::string> &getSwiftBridge() const { return SwiftBridge; } void setSwiftBridge(const Optional<std::string> &swiftType) { SwiftBridge = swiftType; } void setSwiftBridge(const Optional<StringRef> &swiftType) { if (swiftType) SwiftBridge = *swiftType; else SwiftBridge = None; } const Optional<std::string> &getNSErrorDomain() const { return NSErrorDomain; } void setNSErrorDomain(const Optional<std::string> &domain) { NSErrorDomain = domain; } void setNSErrorDomain(const Optional<StringRef> &domain) { if (domain) NSErrorDomain = *domain; else NSErrorDomain = None; } friend CommonTypeInfo &operator|=(CommonTypeInfo &lhs, const CommonTypeInfo &rhs) { static_cast<CommonEntityInfo &>(lhs) |= rhs; if (!lhs.SwiftBridge && rhs.SwiftBridge) lhs.SwiftBridge = rhs.SwiftBridge; if (!lhs.NSErrorDomain && rhs.NSErrorDomain) lhs.NSErrorDomain = rhs.NSErrorDomain; return lhs; } friend bool operator==(const CommonTypeInfo &lhs, const CommonTypeInfo &rhs) { return static_cast<const CommonEntityInfo &>(lhs) == rhs && lhs.SwiftBridge == rhs.SwiftBridge && lhs.NSErrorDomain == rhs.NSErrorDomain; } friend bool operator!=(const CommonTypeInfo &lhs, const CommonTypeInfo &rhs) { return !(lhs == rhs); } }; /// Describes API notes data for an Objective-C class or protocol. class ObjCContextInfo : public CommonTypeInfo { /// Whether this class has a default nullability. unsigned HasDefaultNullability : 1; /// The default nullability. unsigned DefaultNullability : 2; /// Whether this class has designated initializers recorded. unsigned HasDesignatedInits : 1; unsigned SwiftImportAsNonGenericSpecified : 1; unsigned SwiftImportAsNonGeneric : 1; unsigned SwiftObjCMembersSpecified : 1; unsigned SwiftObjCMembers : 1; public: ObjCContextInfo() : CommonTypeInfo(), HasDefaultNullability(0), DefaultNullability(0), HasDesignatedInits(0), SwiftImportAsNonGenericSpecified(false), SwiftImportAsNonGeneric(false), SwiftObjCMembersSpecified(false), SwiftObjCMembers(false) { } /// Determine the default nullability for properties and methods of this /// class. /// /// \returns the default nullability, if implied, or None if there is no Optional<NullabilityKind> getDefaultNullability() const { if (HasDefaultNullability) return static_cast<NullabilityKind>(DefaultNullability); return None; } /// Set the default nullability for properties and methods of this class. void setDefaultNullability(NullabilityKind kind) { HasDefaultNullability = true; DefaultNullability = static_cast<unsigned>(kind); } bool hasDesignatedInits() const { return HasDesignatedInits; } void setHasDesignatedInits(bool value) { HasDesignatedInits = value; } Optional<bool> getSwiftImportAsNonGeneric() const { if (SwiftImportAsNonGenericSpecified) return SwiftImportAsNonGeneric; return None; } void setSwiftImportAsNonGeneric(Optional<bool> value) { if (value.hasValue()) { SwiftImportAsNonGenericSpecified = true; SwiftImportAsNonGeneric = value.getValue(); } else { SwiftImportAsNonGenericSpecified = false; SwiftImportAsNonGeneric = false; } } Optional<bool> getSwiftObjCMembers() const { if (SwiftObjCMembersSpecified) return SwiftObjCMembers; return None; } void setSwiftObjCMembers(Optional<bool> value) { SwiftObjCMembersSpecified = value.hasValue(); SwiftObjCMembers = value.hasValue() ? *value : false; } /// Strip off any information within the class information structure that is /// module-local, such as 'audited' flags. void stripModuleLocalInfo() { HasDefaultNullability = false; DefaultNullability = 0; } friend bool operator==(const ObjCContextInfo &lhs, const ObjCContextInfo &rhs) { return static_cast<const CommonTypeInfo &>(lhs) == rhs && lhs.getDefaultNullability() == rhs.getDefaultNullability() && lhs.HasDesignatedInits == rhs.HasDesignatedInits && lhs.getSwiftImportAsNonGeneric() == rhs.getSwiftImportAsNonGeneric() && lhs.getSwiftObjCMembers() == rhs.getSwiftObjCMembers(); } friend bool operator!=(const ObjCContextInfo &lhs, const ObjCContextInfo &rhs) { return !(lhs == rhs); } friend ObjCContextInfo &operator|=(ObjCContextInfo &lhs, const ObjCContextInfo &rhs) { // Merge inherited info. static_cast<CommonTypeInfo &>(lhs) |= rhs; // Merge nullability. if (!lhs.getDefaultNullability()) { if (auto nullable = rhs.getDefaultNullability()) { lhs.setDefaultNullability(*nullable); } } if (!lhs.SwiftImportAsNonGenericSpecified && rhs.SwiftImportAsNonGenericSpecified) { lhs.SwiftImportAsNonGenericSpecified = true; lhs.SwiftImportAsNonGeneric = rhs.SwiftImportAsNonGeneric; } if (!lhs.SwiftObjCMembersSpecified && rhs.SwiftObjCMembersSpecified) { lhs.SwiftObjCMembersSpecified = true; lhs.SwiftObjCMembers = rhs.SwiftObjCMembers; } lhs.HasDesignatedInits |= rhs.HasDesignatedInits; return lhs; } void dump(llvm::raw_ostream &os); }; /// API notes for a variable/property. class VariableInfo : public CommonEntityInfo { /// Whether this property has been audited for nullability. unsigned NullabilityAudited : 1; /// The kind of nullability for this property. Only valid if the nullability /// has been audited. unsigned Nullable : 2; /// The C type of the variable, as a string. std::string Type; public: VariableInfo() : CommonEntityInfo(), NullabilityAudited(false), Nullable(0) { } Optional<NullabilityKind> getNullability() const { if (NullabilityAudited) return static_cast<NullabilityKind>(Nullable); return None; } void setNullabilityAudited(NullabilityKind kind) { NullabilityAudited = true; Nullable = static_cast<unsigned>(kind); } const std::string &getType() const { return Type; } void setType(const std::string &type) { Type = type; } friend bool operator==(const VariableInfo &lhs, const VariableInfo &rhs) { return static_cast<const CommonEntityInfo &>(lhs) == rhs && lhs.NullabilityAudited == rhs.NullabilityAudited && lhs.Nullable == rhs.Nullable && lhs.Type == rhs.Type; } friend bool operator!=(const VariableInfo &lhs, const VariableInfo &rhs) { return !(lhs == rhs); } friend VariableInfo &operator|=(VariableInfo &lhs, const VariableInfo &rhs) { static_cast<CommonEntityInfo &>(lhs) |= rhs; if (!lhs.NullabilityAudited && rhs.NullabilityAudited) lhs.setNullabilityAudited(*rhs.getNullability()); if (lhs.Type.empty() && !rhs.Type.empty()) lhs.Type = rhs.Type; return lhs; } }; /// Describes API notes data for an Objective-C property. class ObjCPropertyInfo : public VariableInfo { unsigned SwiftImportAsAccessorsSpecified : 1; unsigned SwiftImportAsAccessors : 1; public: ObjCPropertyInfo() : VariableInfo(), SwiftImportAsAccessorsSpecified(false), SwiftImportAsAccessors(false) {} /// Merge class-wide information into the given property. friend ObjCPropertyInfo &operator|=(ObjCPropertyInfo &lhs, const ObjCContextInfo &rhs) { static_cast<VariableInfo &>(lhs) |= rhs; // Merge nullability. if (!lhs.getNullability()) { if (auto nullable = rhs.getDefaultNullability()) { lhs.setNullabilityAudited(*nullable); } } return lhs; } Optional<bool> getSwiftImportAsAccessors() const { if (SwiftImportAsAccessorsSpecified) return SwiftImportAsAccessors; return None; } void setSwiftImportAsAccessors(Optional<bool> value) { if (value.hasValue()) { SwiftImportAsAccessorsSpecified = true; SwiftImportAsAccessors = value.getValue(); } else { SwiftImportAsAccessorsSpecified = false; SwiftImportAsAccessors = false; } } friend ObjCPropertyInfo &operator|=(ObjCPropertyInfo &lhs, const ObjCPropertyInfo &rhs) { lhs |= static_cast<const VariableInfo &>(rhs); if (!lhs.SwiftImportAsAccessorsSpecified && rhs.SwiftImportAsAccessorsSpecified) { lhs.SwiftImportAsAccessorsSpecified = true; lhs.SwiftImportAsAccessors = rhs.SwiftImportAsAccessors; } return lhs; } friend bool operator==(const ObjCPropertyInfo &lhs, const ObjCPropertyInfo &rhs) { return static_cast<const VariableInfo &>(lhs) == rhs && lhs.getSwiftImportAsAccessors() == rhs.getSwiftImportAsAccessors(); } }; /// Describes a function or method parameter. class ParamInfo : public VariableInfo { /// Whether noescape was specified. unsigned NoEscapeSpecified : 1; /// Whether the this parameter has the 'noescape' attribute. unsigned NoEscape : 1; public: ParamInfo() : VariableInfo(), NoEscapeSpecified(false), NoEscape(false) { } Optional<bool> isNoEscape() const { if (!NoEscapeSpecified) return None; return NoEscape; } void setNoEscape(Optional<bool> noescape) { if (noescape) { NoEscapeSpecified = true; NoEscape = *noescape; } else { NoEscapeSpecified = false; NoEscape = false; } } friend ParamInfo &operator|=(ParamInfo &lhs, const ParamInfo &rhs) { static_cast<VariableInfo &>(lhs) |= rhs; if (!lhs.NoEscapeSpecified && rhs.NoEscapeSpecified) { lhs.NoEscapeSpecified = true; lhs.NoEscape = rhs.NoEscape; } return lhs; } friend bool operator==(const ParamInfo &lhs, const ParamInfo &rhs) { return static_cast<const VariableInfo &>(lhs) == rhs && lhs.NoEscapeSpecified == rhs.NoEscapeSpecified && lhs.NoEscape == rhs.NoEscape; } friend bool operator!=(const ParamInfo &lhs, const ParamInfo &rhs) { return !(lhs == rhs); } }; /// A temporary reference to an Objective-C selector, suitable for /// referencing selector data on the stack. /// /// Instances of this struct do not store references to any of the /// data they contain; it is up to the user to ensure that the data /// referenced by the identifier list persists. struct ObjCSelectorRef { unsigned NumPieces; ArrayRef<StringRef> Identifiers; }; /// API notes for a function or method. class FunctionInfo : public CommonEntityInfo { private: static unsigned const NullabilityKindMask = 0x3; static unsigned const NullabilityKindSize = 2; public: /// Whether the signature has been audited with respect to nullability. /// If yes, we consider all types to be non-nullable unless otherwise noted. /// If this flag is not set, the pointer types are considered to have /// unknown nullability. unsigned NullabilityAudited : 1; /// Number of types whose nullability is encoded with the NullabilityPayload. unsigned NumAdjustedNullable : 8; /// Stores the nullability of the return type and the parameters. // NullabilityKindSize bits are used to encode the nullability. The info // about the return type is stored at position 0, followed by the nullability // of the parameters. uint64_t NullabilityPayload = 0; /// The result type of this function, as a C type. std::string ResultType; /// The function parameters. std::vector<ParamInfo> Params; FunctionInfo() : CommonEntityInfo(), NullabilityAudited(false), NumAdjustedNullable(0) { } static unsigned getMaxNullabilityIndex() { return ((sizeof(NullabilityPayload) * CHAR_BIT)/NullabilityKindSize); } void addTypeInfo(unsigned index, NullabilityKind kind) { assert(index <= getMaxNullabilityIndex()); assert(static_cast<unsigned>(kind) < NullabilityKindMask); NullabilityAudited = true; if (NumAdjustedNullable < index + 1) NumAdjustedNullable = index + 1; // Mask the bits. NullabilityPayload &= ~(NullabilityKindMask << (index * NullabilityKindSize)); // Set the value. unsigned kindValue = (static_cast<unsigned>(kind)) << (index * NullabilityKindSize); NullabilityPayload |= kindValue; } /// Adds the return type info. void addReturnTypeInfo(NullabilityKind kind) { addTypeInfo(0, kind); } /// Adds the parameter type info. void addParamTypeInfo(unsigned index, NullabilityKind kind) { addTypeInfo(index + 1, kind); } private: NullabilityKind getTypeInfo(unsigned index) const { assert(NullabilityAudited && "Checking the type adjustment on non-audited method."); // If we don't have info about this parameter, return the default. if (index > NumAdjustedNullable) return NullabilityKind::NonNull; return static_cast<NullabilityKind>(( NullabilityPayload >> (index * NullabilityKindSize) ) & NullabilityKindMask); } public: NullabilityKind getParamTypeInfo(unsigned index) const { return getTypeInfo(index + 1); } NullabilityKind getReturnTypeInfo() const { return getTypeInfo(0); } friend bool operator==(const FunctionInfo &lhs, const FunctionInfo &rhs) { return static_cast<const CommonEntityInfo &>(lhs) == rhs && lhs.NullabilityAudited == rhs.NullabilityAudited && lhs.NumAdjustedNullable == rhs.NumAdjustedNullable && lhs.NullabilityPayload == rhs.NullabilityPayload && lhs.ResultType == rhs.ResultType && lhs.Params == rhs.Params; } friend bool operator!=(const FunctionInfo &lhs, const FunctionInfo &rhs) { return !(lhs == rhs); } }; /// Describes API notes data for an Objective-C method. class ObjCMethodInfo : public FunctionInfo { public: /// Whether this is a designated initializer of its class. unsigned DesignatedInit : 1; /// Whether this is a required initializer. unsigned Required : 1; ObjCMethodInfo() : FunctionInfo(), DesignatedInit(false), Required(false) { } friend bool operator==(const ObjCMethodInfo &lhs, const ObjCMethodInfo &rhs) { return static_cast<const FunctionInfo &>(lhs) == rhs && lhs.DesignatedInit == rhs.DesignatedInit && lhs.Required == rhs.Required; } friend bool operator!=(const ObjCMethodInfo &lhs, const ObjCMethodInfo &rhs) { return !(lhs == rhs); } void mergePropInfoIntoSetter(const ObjCPropertyInfo &pInfo); void mergePropInfoIntoGetter(const ObjCPropertyInfo &pInfo); /// Merge class-wide information into the given method. friend ObjCMethodInfo &operator|=(ObjCMethodInfo &lhs, const ObjCContextInfo &rhs) { // Merge nullability. if (!lhs.NullabilityAudited) { if (auto nullable = rhs.getDefaultNullability()) { lhs.NullabilityAudited = true; lhs.addTypeInfo(0, *nullable); } } return lhs; } void dump(llvm::raw_ostream &os); }; /// Describes API notes data for a global variable. class GlobalVariableInfo : public VariableInfo { public: GlobalVariableInfo() : VariableInfo() { } }; /// Describes API notes data for a global function. class GlobalFunctionInfo : public FunctionInfo { public: GlobalFunctionInfo() : FunctionInfo() { } }; /// Describes API notes data for an enumerator. class EnumConstantInfo : public CommonEntityInfo { public: EnumConstantInfo() : CommonEntityInfo() { } }; /// The payload for an enum_extensibility attribute. This is a tri-state rather /// than just a boolean because the presence of the attribute indicates /// auditing. enum class EnumExtensibilityKind { None, Open, Closed, }; /// Describes API notes data for a tag. class TagInfo : public CommonTypeInfo { unsigned HasFlagEnum : 1; unsigned IsFlagEnum : 1; public: Optional<EnumExtensibilityKind> EnumExtensibility; Optional<bool> isFlagEnum() const { if (HasFlagEnum) return IsFlagEnum; return None; } void setFlagEnum(Optional<bool> Value) { if (Value.hasValue()) { HasFlagEnum = true; IsFlagEnum = Value.getValue(); } else { HasFlagEnum = false; } } TagInfo() : CommonTypeInfo(), HasFlagEnum(0), IsFlagEnum(0) { } friend TagInfo &operator|=(TagInfo &lhs, const TagInfo &rhs) { lhs |= static_cast<const CommonTypeInfo &>(rhs); if (!lhs.HasFlagEnum && rhs.HasFlagEnum) { lhs.HasFlagEnum = true; lhs.IsFlagEnum = rhs.IsFlagEnum; } if (!lhs.EnumExtensibility.hasValue() && rhs.EnumExtensibility.hasValue()) lhs.EnumExtensibility = rhs.EnumExtensibility; return lhs; } friend bool operator==(const TagInfo &lhs, const TagInfo &rhs) { return static_cast<const CommonTypeInfo &>(lhs) == rhs && lhs.isFlagEnum() == rhs.isFlagEnum() && lhs.EnumExtensibility == rhs.EnumExtensibility; } }; /// The kind of a swift_wrapper/swift_newtype. enum class SwiftWrapperKind { None, Struct, Enum }; /// Describes API notes data for a typedef. class TypedefInfo : public CommonTypeInfo { public: Optional<SwiftWrapperKind> SwiftWrapper; TypedefInfo() : CommonTypeInfo() { } friend TypedefInfo &operator|=(TypedefInfo &lhs, const TypedefInfo &rhs) { lhs |= static_cast<const CommonTypeInfo &>(rhs); if (!lhs.SwiftWrapper.hasValue() && rhs.SwiftWrapper.hasValue()) lhs.SwiftWrapper = rhs.SwiftWrapper; return lhs; } friend bool operator==(const TypedefInfo &lhs, const TypedefInfo &rhs) { return static_cast<const CommonTypeInfo &>(lhs) == rhs && lhs.SwiftWrapper == rhs.SwiftWrapper; } }; /// Descripts a series of options for a module struct ModuleOptions { bool SwiftInferImportAsMember = false; }; } // end namespace api_notes } // end namespace clang #endif // LLVM_CLANG_API_NOTES_TYPES_H
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Interpreter/OptionValue.h
//===-- OptionValue.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_OptionValue_h_ #define liblldb_OptionValue_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Core/ConstString.h" #include "lldb/Core/Error.h" #include "lldb/Core/FormatEntity.h" #include "lldb/lldb-defines.h" namespace lldb_private { //--------------------------------------------------------------------- // OptionValue //--------------------------------------------------------------------- class OptionValue { public: typedef enum { eTypeInvalid = 0, eTypeArch, eTypeArgs, eTypeArray, eTypeBoolean, eTypeChar, eTypeDictionary, eTypeEnum, eTypeFileSpec, eTypeFileSpecList, eTypeFormat, eTypeLanguage, eTypePathMap, eTypeProperties, eTypeRegex, eTypeSInt64, eTypeString, eTypeUInt64, eTypeUUID, eTypeFormatEntity } Type; enum { eDumpOptionName = (1u << 0), eDumpOptionType = (1u << 1), eDumpOptionValue = (1u << 2), eDumpOptionDescription = (1u << 3), eDumpOptionRaw = (1u << 4), eDumpGroupValue = (eDumpOptionName | eDumpOptionType | eDumpOptionValue), eDumpGroupHelp = (eDumpOptionName | eDumpOptionType | eDumpOptionDescription) }; OptionValue() : m_callback(nullptr), m_baton(nullptr), m_value_was_set(false) {} OptionValue(const OptionValue &rhs) : m_callback(rhs.m_callback), m_baton(rhs.m_baton), m_value_was_set(rhs.m_value_was_set) {} virtual ~OptionValue() = default; //----------------------------------------------------------------- // Subclasses should override these functions //----------------------------------------------------------------- virtual Type GetType() const = 0; // If this value is always hidden, the avoid showing any info on this // value, just show the info for the child values. virtual bool ValueIsTransparent() const { return GetType() == eTypeProperties; } virtual const char *GetTypeAsCString() const { return GetBuiltinTypeAsCString(GetType()); } static const char *GetBuiltinTypeAsCString(Type t); virtual void DumpValue(const ExecutionContext *exe_ctx, Stream &strm, uint32_t dump_mask) = 0; virtual Error SetValueFromString(llvm::StringRef value, VarSetOperationType op = eVarSetOperationAssign); virtual bool Clear() = 0; virtual lldb::OptionValueSP DeepCopy() const = 0; virtual size_t AutoComplete(CommandInterpreter &interpreter, llvm::StringRef s, int match_start_point, int max_return_elements, bool &word_complete, StringList &matches); //----------------------------------------------------------------- // Subclasses can override these functions //----------------------------------------------------------------- virtual lldb::OptionValueSP GetSubValue(const ExecutionContext *exe_ctx, llvm::StringRef name, bool will_modify, Error &error) const { error.SetErrorStringWithFormat("'%s' is not a value subvalue", name.str().c_str()); return lldb::OptionValueSP(); } virtual Error SetSubValue(const ExecutionContext *exe_ctx, VarSetOperationType op, llvm::StringRef name, llvm::StringRef value); virtual bool IsAggregateValue() const { return false; } virtual ConstString GetName() const { return ConstString(); } virtual bool DumpQualifiedName(Stream &strm) const; //----------------------------------------------------------------- // Subclasses should NOT override these functions as they use the // above functions to implement functionality //----------------------------------------------------------------- uint32_t GetTypeAsMask() { return 1u << GetType(); } static uint32_t ConvertTypeToMask(OptionValue::Type type) { return 1u << type; } static OptionValue::Type ConvertTypeMaskToType(uint32_t type_mask) { // If only one bit is set, then return an appropriate enumeration switch (type_mask) { case 1u << eTypeArch: return eTypeArch; case 1u << eTypeArgs: return eTypeArgs; case 1u << eTypeArray: return eTypeArray; case 1u << eTypeBoolean: return eTypeBoolean; case 1u << eTypeChar: return eTypeChar; case 1u << eTypeDictionary: return eTypeDictionary; case 1u << eTypeEnum: return eTypeEnum; case 1u << eTypeFileSpec: return eTypeFileSpec; case 1u << eTypeFileSpecList: return eTypeFileSpecList; case 1u << eTypeFormat: return eTypeFormat; case 1u << eTypeLanguage: return eTypeLanguage; case 1u << eTypePathMap: return eTypePathMap; case 1u << eTypeProperties: return eTypeProperties; case 1u << eTypeRegex: return eTypeRegex; case 1u << eTypeSInt64: return eTypeSInt64; case 1u << eTypeString: return eTypeString; case 1u << eTypeUInt64: return eTypeUInt64; case 1u << eTypeUUID: return eTypeUUID; } // Else return invalid return eTypeInvalid; } static lldb::OptionValueSP CreateValueFromCStringForTypeMask(const char *value_cstr, uint32_t type_mask, Error &error); // Get this value as a uint64_t value if it is encoded as a boolean, // uint64_t or int64_t. Other types will cause "fail_value" to be // returned uint64_t GetUInt64Value(uint64_t fail_value, bool *success_ptr); OptionValueArch *GetAsArch(); const OptionValueArch *GetAsArch() const; OptionValueArray *GetAsArray(); const OptionValueArray *GetAsArray() const; OptionValueArgs *GetAsArgs(); const OptionValueArgs *GetAsArgs() const; OptionValueBoolean *GetAsBoolean(); OptionValueChar *GetAsChar(); const OptionValueBoolean *GetAsBoolean() const; const OptionValueChar *GetAsChar() const; OptionValueDictionary *GetAsDictionary(); const OptionValueDictionary *GetAsDictionary() const; OptionValueEnumeration *GetAsEnumeration(); const OptionValueEnumeration *GetAsEnumeration() const; OptionValueFileSpec *GetAsFileSpec(); const OptionValueFileSpec *GetAsFileSpec() const; OptionValueFileSpecList *GetAsFileSpecList(); const OptionValueFileSpecList *GetAsFileSpecList() const; OptionValueFormat *GetAsFormat(); const OptionValueFormat *GetAsFormat() const; OptionValueLanguage *GetAsLanguage(); const OptionValueLanguage *GetAsLanguage() const; OptionValuePathMappings *GetAsPathMappings(); const OptionValuePathMappings *GetAsPathMappings() const; OptionValueProperties *GetAsProperties(); const OptionValueProperties *GetAsProperties() const; OptionValueRegex *GetAsRegex(); const OptionValueRegex *GetAsRegex() const; OptionValueSInt64 *GetAsSInt64(); const OptionValueSInt64 *GetAsSInt64() const; OptionValueString *GetAsString(); const OptionValueString *GetAsString() const; OptionValueUInt64 *GetAsUInt64(); const OptionValueUInt64 *GetAsUInt64() const; OptionValueUUID *GetAsUUID(); const OptionValueUUID *GetAsUUID() const; OptionValueFormatEntity *GetAsFormatEntity(); const OptionValueFormatEntity *GetAsFormatEntity() const; bool GetBooleanValue(bool fail_value = false) const; bool SetBooleanValue(bool new_value); char GetCharValue(char fail_value) const; char SetCharValue(char new_value); int64_t GetEnumerationValue(int64_t fail_value = -1) const; bool SetEnumerationValue(int64_t value); FileSpec GetFileSpecValue() const; bool SetFileSpecValue(const FileSpec &file_spec); FileSpecList GetFileSpecListValue() const; lldb::Format GetFormatValue(lldb::Format fail_value = lldb::eFormatDefault) const; bool SetFormatValue(lldb::Format new_value); lldb::LanguageType GetLanguageValue( lldb::LanguageType fail_value = lldb::eLanguageTypeUnknown) const; bool SetLanguageValue(lldb::LanguageType new_language); const FormatEntity::Entry *GetFormatEntity() const; const RegularExpression *GetRegexValue() const; int64_t GetSInt64Value(int64_t fail_value = 0) const; bool SetSInt64Value(int64_t new_value); llvm::StringRef GetStringValue(llvm::StringRef fail_value) const; llvm::StringRef GetStringValue() const { return GetStringValue(llvm::StringRef()); } bool SetStringValue(llvm::StringRef new_value); uint64_t GetUInt64Value(uint64_t fail_value = 0) const; bool SetUInt64Value(uint64_t new_value); UUID GetUUIDValue() const; bool SetUUIDValue(const UUID &uuid); bool OptionWasSet() const { return m_value_was_set; } void SetOptionWasSet() { m_value_was_set = true; } void SetParent(const lldb::OptionValueSP &parent_sp) { m_parent_wp = parent_sp; } void SetValueChangedCallback(OptionValueChangedCallback callback, void *baton) { assert(m_callback == nullptr); m_callback = callback; m_baton = baton; } void NotifyValueChanged() { if (m_callback) m_callback(m_baton, this); } protected: lldb::OptionValueWP m_parent_wp; OptionValueChangedCallback m_callback; void *m_baton; bool m_value_was_set; // This can be used to see if a value has been set // by a call to SetValueFromCString(). It is often // handy to know if an option value was set from // the command line or as a setting, versus if we // just have the default value that was already // populated in the option value. }; } // namespace lldb_private #endif // liblldb_OptionValue_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Driver/arm-execute-only.c
// RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv6t2-eabi -### -mexecute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv6t2-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv7m-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv7m-eabi -### -mexecute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv7m-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.base-eabi -### -mexecute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv8m.base-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.main-eabi -### -mexecute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv8m.main-eabi -### -mexecute-only -mno-execute-only %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: not %clang -c -target thumbv6m-eabi -mexecute-only %s 2>&1 | \ // RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s // RUN: not %clang -target armv8m.main-eabi -mexecute-only -mno-movt %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-NO-MOVT // RUN: not %clang -target armv8m.main-eabi -mexecute-only -mlong-calls %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-LONG-CALLS // -mpure-code flag for GCC compatibility // RUN: %clang -target armv6t2-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv6t2-eabi -### -mpure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv6t2-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv7m-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv7m-eabi -### -mpure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv7m-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.base-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.base-eabi -### -mpure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv8m.base-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.main-eabi -### %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: %clang -target armv8m.main-eabi -### -mpure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY // RUN: %clang -target armv8m.main-eabi -### -mpure-code -mno-pure-code %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-NO-EXECUTE-ONLY // RUN: not %clang -c -target thumbv6m-eabi -mpure-code %s 2>&1 | \ // RUN: FileCheck --check-prefix CHECK-EXECUTE-ONLY-NOT-SUPPORTED %s // RUN: not %clang -target armv8m.main-eabi -mpure-code -mno-movt %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-NO-MOVT // RUN: not %clang -target armv8m.main-eabi -mpure-code -mlong-calls %s 2>&1 \ // RUN: | FileCheck %s -check-prefix CHECK-EXECUTE-ONLY-LONG-CALLS // // CHECK-NO-EXECUTE-ONLY-NOT: "-backend-option" "-arm-execute-only" // CHECK-EXECUTE-ONLY: "-backend-option" "-arm-execute-only" // CHECK-EXECUTE-ONLY-NOT-SUPPORTED: error: execute only is not supported for the thumbv6m sub-architecture // CHECK-EXECUTE-ONLY-NO-MOVT: error: option '-mexecute-only' cannot be specified with '-mno-movt' // CHECK-EXECUTE-ONLY-LONG-CALLS: error: option '-mexecute-only' cannot be specified with '-mlong-calls'
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/functionalities/unwind/ehframe/main.c
void func() { #ifndef __mips__ __asm__ ( "pushq $0x10;" ".cfi_def_cfa_offset 16;" "jmp label;" "movq $0x48, %rax;" "label: subq $0x38, %rax;" "movq $0x48, %rcx;" "movq $0x48, %rdx;" "movq $0x48, %rax;" "popq %rax;" ); #elif __mips64 __asm__ ( "daddiu $sp,$sp,-16;" ".cfi_def_cfa_offset 16;" "sd $ra,8($sp);" ".cfi_offset 31, -8;" "daddiu $ra,$zero,0;" "ld $ra,8($sp);" "daddiu $sp, $sp,16;" ".cfi_restore 31;" ".cfi_def_cfa_offset 0;" ); #else // For MIPS32 __asm__ ( "addiu $sp,$sp,-8;" ".cfi_def_cfa_offset 8;" "sw $ra,4($sp);" ".cfi_offset 31, -4;" "addiu $ra,$zero,0;" "lw $ra,4($sp);" "addiu $sp,$sp,8;" ".cfi_restore 31;" ".cfi_def_cfa_offset 0;" ); #endif } int main(int argc, char const *argv[]) { func(); }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/tools/lldb-mi/symbol/symbol_list_lines_inline_test.h
<reponame>Polidea/SiriusObfuscator<gh_stars>100-1000 namespace ns { inline int ifunc(int i) { // FUNC_ifunc return i; } struct S { int a; int b; S() : a(3) , b(4) { } int mfunc() { // FUNC_mfunc return a + b; } }; extern S s; }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/APINotes/yaml-os-availability.c
<filename>SymbolExtractorAndRenamer/clang/test/APINotes/yaml-os-availability.c<gh_stars>100-1000 # RUN: %clang -cc1apinotes -yaml-to-binary -target i386-apple-ios7 -o %t-ios.apinotesc %S/Inputs/os-availability.apinotes # RUN: %clang -cc1apinotes -binary-to-yaml %t-ios.apinotesc -o %t.os-availability-ios.apinotes # RUN: FileCheck %s -check-prefix=IOS < %t.os-availability-ios.apinotes # RUN: %clang -cc1apinotes -yaml-to-binary -target x86_64-apple-macosx10.9 -o %t-osx.apinotesc %S/Inputs/os-availability.apinotes # RUN: %clang -cc1apinotes -binary-to-yaml %t-osx.apinotesc -o %t.os-availability-osx.apinotes # RUN: FileCheck %s -check-prefix=OSX < %t.os-availability-osx.apinotes # IOS: Foundation # IOS: NSArray # IOS: initWithObjects # IOS: familyNameios # IOS: fontName # IOS: NSCountedSet # IOS: UIApplicationDelegate # IOS: UIApplicationDelegateIOS # IOS: NSAvailableWindowDepths # IOS: NSAvailableWindowDepthsiOS # IOS-NOT: NSCalibratedWhiteColorSpace # OSX: Foundation # qqOSX: NSArray # OSX-NOT: initWithObjects # OSX-NOT: familyNameios # OSX: fontName # OSX-NOT: NSCountedSet # OSX: UIApplicationDelegate # OSX-NOT: UIApplicationDelegateIOS # OSX: NSAvailableWindowDepths # OSX-NOT: NSAvailableWindowDepthsiOS # OSX: NSCalibratedWhiteColorSpace
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/make/test_common.h
<reponame>Polidea/SiriusObfuscator // This header is included in all the test programs (C and C++) and provides a // hook for dealing with platform-specifics. #if defined(_WIN32) || defined(_WIN64) #ifdef COMPILING_LLDB_TEST_DLL #define LLDB_TEST_API __declspec(dllexport) #else #define LLDB_TEST_API __declspec(dllimport) #endif #else #define LLDB_TEST_API #endif #if defined(__cplusplus) && defined(_MSC_VER) && (_HAS_EXCEPTIONS == 0) // Compiling MSVC libraries with _HAS_EXCEPTIONS=0, eliminates most but not all // calls to __uncaught_exception. Unfortunately, it does seem to eliminate // the delcaration of __uncaught_excpeiton. Including <eh.h> ensures that it is // declared. This may not be necessary after MSVC 12. #include <eh.h> #endif #if defined(_WIN32) #define LLVM_PRETTY_FUNCTION __FUNCSIG__ #else #define LLVM_PRETTY_FUNCTION LLVM_PRETTY_FUNCTION #endif // On some systems (e.g., some versions of linux) it is not possible to attach to a process // without it giving us special permissions. This defines the lldb_enable_attach macro, which // should perform any such actions, if needed by the platform. This is a macro instead of a // function to avoid the need for complex linking of the test programs. #if defined(__linux__) #include <sys/prctl.h> // Android API <= 16 does not have these defined. #ifndef PR_SET_PTRACER #define PR_SET_PTRACER 0x59616d61 #endif #ifndef PR_SET_PTRACER_ANY #define PR_SET_PTRACER_ANY ((unsigned long)-1) #endif // For now we execute on best effort basis. If this fails for some reason, so be it. #define lldb_enable_attach() \ do \ { \ const int prctl_result = prctl(PR_SET_PTRACER, PR_SET_PTRACER_ANY, 0, 0, 0); \ (void)prctl_result; \ } while (0) #else // not linux #define lldb_enable_attach() #endif #if defined(__APPLE__) && defined(LLDB_USING_LIBSTDCPP) // on Darwin, libstdc++ is missing <atomic>, so this would cause any test to fail building // since this header file is being included in every C-family test case, we need to not include it // on Darwin, most tests use libc++ by default, so this will only affect tests that explicitly require libstdc++ #else #ifdef __cplusplus #include <atomic> // Note that although hogging the CPU while waiting for a variable to change // would be terrible in production code, it's great for testing since it // avoids a lot of messy context switching to get multiple threads synchronized. typedef std::atomic<int> pseudo_barrier_t; #define pseudo_barrier_wait(barrier) \ do \ { \ --(barrier); \ while ((barrier).load() > 0) \ ; \ } while (0) #define pseudo_barrier_init(barrier, count) \ do \ { \ (barrier) = (count); \ } while (0) #endif // __cplusplus #endif // defined(__APPLE__) && defined(LLDB_USING_LIBSTDCPP)
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/APINotes/yaml-reader-errors.c
# RUN: not %clang -cc1apinotes -yaml-to-binary -target i386-apple-ios7 -o %t.apinotesc %s > %t.err 2>&1 # RUN: FileCheck %s < %t.err --- Name: UIKit Availability: iOS AvailabilityMsg: iOSOnly Classes: - Name: UIFont Availability: iOS AvailabilityMsg: iOSOnly Methods: - Selector: 'fontWithName:size:' MethodKind: Instance Nullability: [ N ] NullabilityOfRet: O Availability: iOS AvailabilityMsg: iOSOnly DesignatedInit: true # CHECK: duplicate definition of method '-[UIFont fontWithName:size:]' - Selector: 'fontWithName:size:' MethodKind: Instance Nullability: [ N ] NullabilityOfRet: O Availability: iOS AvailabilityMsg: iOSOnly DesignatedInit: true Properties: - Name: familyName Nullability: N Availability: iOS AvailabilityMsg: iOSOnly - Name: fontName Nullability: N Availability: iOS AvailabilityMsg: iOSOnly # CHECK: duplicate definition of instance property 'UIFont.familyName' - Name: familyName Nullability: N Availability: iOS AvailabilityMsg: iOSOnly # CHECK: multiple definitions of class 'UIFont' - Name: UIFont Protocols: - Name: MyProto AuditedForNullability: true # CHECK: multiple definitions of protocol 'MyProto' - Name: MyProto AuditedForNullability: true Functions: - Name: 'globalFoo' Nullability: [ N, N, O, S ] NullabilityOfRet: O Availability: iOS AvailabilityMsg: iOSOnly - Name: 'globalFoo2' Nullability: [ N, N, O, S ] NullabilityOfRet: O Globals: - Name: globalVar Nullability: O Availability: iOS AvailabilityMsg: iOSOnly - Name: globalVar2 Nullability: O Tags: # CHECK: cannot mix EnumKind and FlagEnum (for FlagAndEnumKind) - Name: FlagAndEnumKind FlagEnum: true EnumKind: CFOptions # CHECK: cannot mix EnumKind and FlagEnum (for FlagAndEnumKind2) - Name: FlagAndEnumKind2 EnumKind: CFOptions FlagEnum: false # CHECK: cannot mix EnumKind and EnumExtensibility (for ExtensibilityAndEnumKind) - Name: ExtensibilityAndEnumKind EnumExtensibility: open EnumKind: CFOptions # CHECK: cannot mix EnumKind and EnumExtensibility (for ExtensibilityAndEnumKind2) - Name: ExtensibilityAndEnumKind2 EnumKind: CFOptions EnumExtensibility: closed # CHECK: cannot mix EnumKind and EnumExtensibility (for ExtensibilityAndEnumKind3) - Name: ExtensibilityAndEnumKind3 EnumKind: none EnumExtensibility: none
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/CodeGen/split-debug-filename.c
<reponame>Polidea/SiriusObfuscator // RUN: %clang_cc1 -debug-info-kind=limited -split-dwarf-file foo.dwo -S -emit-llvm -o - %s | FileCheck %s int main (void) { return 0; } // Testing to ensure that the dwo name gets output into the compile unit. // CHECK: !DICompileUnit({{.*}}, splitDebugFilename: "foo.dwo"
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h
<filename>SymbolExtractorAndRenamer/lldb/source/Plugins/ExpressionParser/Clang/ClangPersistentVariables.h //===-- ClangPersistentVariables.h ------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ClangPersistentVariables_h_ #define liblldb_ClangPersistentVariables_h_ // C Includes // C++ Includes // Other libraries and framework includes #include "llvm/ADT/DenseMap.h" // Project includes #include "ClangExpressionVariable.h" #include "ClangModulesDeclVendor.h" #include "lldb/Expression/ExpressionVariable.h" #include "llvm/ADT/DenseMap.h" #include "llvm/ADT/StringRef.h" #include <set> #include <string> #include <unordered_map> namespace lldb_private { //---------------------------------------------------------------------- /// @class ClangPersistentVariables ClangPersistentVariables.h /// "lldb/Expression/ClangPersistentVariables.h" /// @brief Manages persistent values that need to be preserved between /// expression invocations. /// /// A list of variables that can be accessed and updated by any expression. See /// ClangPersistentVariable for more discussion. Also provides an increasing, /// 0-based counter for naming result variables. //---------------------------------------------------------------------- class ClangPersistentVariables : public PersistentExpressionState { public: //---------------------------------------------------------------------- /// Constructor //---------------------------------------------------------------------- ClangPersistentVariables(); ~ClangPersistentVariables() override = default; //------------------------------------------------------------------ // llvm casting support //------------------------------------------------------------------ static bool classof(const PersistentExpressionState *pv) { return pv->getKind() == PersistentExpressionState::eKindClang; } lldb::ExpressionVariableSP CreatePersistentVariable(const lldb::ValueObjectSP &valobj_sp) override; lldb::ExpressionVariableSP CreatePersistentVariable( ExecutionContextScope *exe_scope, const ConstString &name, const CompilerType &compiler_type, lldb::ByteOrder byte_order, uint32_t addr_byte_size) override; //---------------------------------------------------------------------- /// Return the next entry in the sequence of strings "$0", "$1", ... for /// use naming persistent expression convenience variables. /// /// @param[in] language_type /// The language for the expression, which can affect the prefix /// /// @param[in] is_error /// If true, an error variable name is produced. /// /// @return /// A string that contains the next persistent variable name. //---------------------------------------------------------------------- ConstString GetNextPersistentVariableName(bool is_error = false) override; void RemovePersistentVariable(lldb::ExpressionVariableSP variable) override; // This just adds this module to the list of hand-loaded modules, it doesn't // actually load it. void AddHandLoadedModule(const ConstString &module_name) { m_hand_loaded_modules.insert(module_name); } using HandLoadedModuleCallback = std::function<bool(const ConstString)>; bool RunOverHandLoadedModules(HandLoadedModuleCallback callback) { for (ConstString name : m_hand_loaded_modules) { if (!callback(name)) return false; } return true; } void RegisterPersistentDecl(const ConstString &name, clang::NamedDecl *decl); clang::NamedDecl *GetPersistentDecl(const ConstString &name); void AddHandLoadedClangModule(ClangModulesDeclVendor::ModuleID module) { m_hand_loaded_clang_modules.push_back(module); } const ClangModulesDeclVendor::ModuleVector &GetHandLoadedClangModules() { return m_hand_loaded_clang_modules; } private: uint32_t m_next_persistent_variable_id; ///< The counter used by ///GetNextResultName(). uint32_t m_next_persistent_error_id; ///< The counter used by ///GetNextResultName() when is_error is ///true. typedef llvm::DenseMap<const char *, clang::TypeDecl *> ClangPersistentTypeMap; ClangPersistentTypeMap m_clang_persistent_types; ///< The persistent types declared by the user. typedef std::set<lldb::IRExecutionUnitSP> ExecutionUnitSet; ExecutionUnitSet m_execution_units; ///< The execution units that contain valuable symbols. typedef std::set<lldb_private::ConstString> HandLoadedModuleSet; HandLoadedModuleSet m_hand_loaded_modules; ///< These are the names of modules ///that we have loaded by ///< hand into the Contexts we make for parsing. typedef llvm::DenseMap<const char *, lldb::addr_t> SymbolMap; SymbolMap m_symbol_map; ///< The addresses of the symbols in m_execution_units. typedef llvm::DenseMap<const char *, clang::NamedDecl *> PersistentDeclMap; PersistentDeclMap m_persistent_decls; ///< Persistent entities declared by the user. ClangModulesDeclVendor::ModuleVector m_hand_loaded_clang_modules; ///< These are Clang modules we hand-loaded; ///these are the highest- ///< priority source for macros. }; } // namespace lldb_private #endif // liblldb_ClangPersistentVariables_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/History.h
//===-- History.h -----------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef lldb_History_h_ #define lldb_History_h_ // C Includes #include <stdint.h> // C++ Includes #include <mutex> #include <stack> #include <string> // Other libraries and framework includes // Project includes #include "lldb/lldb-public.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class HistorySource History.h "lldb/Core/History.h" /// @brief A class that defines history events. //---------------------------------------------------------------------- class HistorySource { public: typedef const void *HistoryEvent; HistorySource() : m_mutex(), m_events() {} virtual ~HistorySource() {} // Create a new history event. Subclasses should use any data or members // in the subclass of this class to produce a history event and push it // onto the end of the history stack. virtual HistoryEvent CreateHistoryEvent() = 0; virtual void DeleteHistoryEvent(HistoryEvent event) = 0; virtual void DumpHistoryEvent(Stream &strm, HistoryEvent event) = 0; virtual size_t GetHistoryEventCount() = 0; virtual HistoryEvent GetHistoryEventAtIndex(uint32_t idx) = 0; virtual HistoryEvent GetCurrentHistoryEvent() = 0; // Return 0 when lhs == rhs, 1 if lhs > rhs, or -1 if lhs < rhs. virtual int CompareHistoryEvents(const HistoryEvent lhs, const HistoryEvent rhs) = 0; virtual bool IsCurrentHistoryEvent(const HistoryEvent event) = 0; private: typedef std::stack<HistoryEvent> collection; std::recursive_mutex m_mutex; collection m_events; DISALLOW_COPY_AND_ASSIGN(HistorySource); }; //---------------------------------------------------------------------- /// @class HistorySourceUInt History.h "lldb/Core/History.h" /// @brief A class that defines history events that are represented by /// unsigned integers. /// /// Any history event that is defined by a unique monotonically /// increasing unsigned integer //---------------------------------------------------------------------- class HistorySourceUInt : public HistorySource { HistorySourceUInt(const char *id_name, uintptr_t start_value = 0u) : HistorySource(), m_name(id_name), m_curr_id(start_value) {} ~HistorySourceUInt() override {} // Create a new history event. Subclasses should use any data or members // in the subclass of this class to produce a history event and push it // onto the end of the history stack. HistoryEvent CreateHistoryEvent() override { ++m_curr_id; return (HistoryEvent)m_curr_id; } void DeleteHistoryEvent(HistoryEvent event) override { // Nothing to delete, the event contains the integer } void DumpHistoryEvent(Stream &strm, HistoryEvent event) override; size_t GetHistoryEventCount() override { return m_curr_id; } HistoryEvent GetHistoryEventAtIndex(uint32_t idx) override { return (HistoryEvent)((uintptr_t)idx); } HistoryEvent GetCurrentHistoryEvent() override { return (HistoryEvent)m_curr_id; } // Return 0 when lhs == rhs, 1 if lhs > rhs, or -1 if lhs < rhs. int CompareHistoryEvents(const HistoryEvent lhs, const HistoryEvent rhs) override { uintptr_t lhs_uint = (uintptr_t)lhs; uintptr_t rhs_uint = (uintptr_t)rhs; if (lhs_uint < rhs_uint) return -1; if (lhs_uint > rhs_uint) return +1; return 0; } bool IsCurrentHistoryEvent(const HistoryEvent event) override { return (uintptr_t)event == m_curr_id; } protected: std::string m_name; // The name of the history unsigned integer uintptr_t m_curr_id; // The current value of the history unsigned unteger }; } // namespace lldb_private #endif // lldb_History_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Language/ObjC/Cocoa.h
//===-- Cocoa.h ---------------------------------------------------*- C++ //-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Cocoa_h_ #define liblldb_Cocoa_h_ #include "lldb/Core/Stream.h" #include "lldb/Core/ValueObject.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Target/ObjCLanguageRuntime.h" namespace lldb_private { namespace formatters { bool NSStringSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSIndexSetSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSArraySummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); template <bool needs_at> bool NSDataSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSNumberSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSNotificationSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSTimeZoneSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSMachPortSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSDateSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSBundleSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSURLSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); extern template bool NSDataSummaryProvider<true>(ValueObject &, Stream &, const TypeSummaryOptions &); extern template bool NSDataSummaryProvider<false>(ValueObject &, Stream &, const TypeSummaryOptions &); SyntheticChildrenFrontEnd * NSArraySyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); SyntheticChildrenFrontEnd * NSIndexPathSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); bool ObjCClassSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); SyntheticChildrenFrontEnd * ObjCClassSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP); bool ObjCBOOLSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool ObjCBooleanSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); template <bool is_sel_ptr> bool ObjCSELSummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); extern template bool ObjCSELSummaryProvider<true>(ValueObject &, Stream &, const TypeSummaryOptions &); extern template bool ObjCSELSummaryProvider<false>(ValueObject &, Stream &, const TypeSummaryOptions &); bool NSError_SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); bool NSException_SummaryProvider(ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options); SyntheticChildrenFrontEnd * NSErrorSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp); SyntheticChildrenFrontEnd * NSExceptionSyntheticFrontEndCreator(CXXSyntheticChildren *, lldb::ValueObjectSP valobj_sp); class NSArray_Additionals { public: static std::map<ConstString, CXXFunctionSummaryFormat::Callback> & GetAdditionalSummaries(); static std::map<ConstString, CXXSyntheticChildren::CreateFrontEndCallback> & GetAdditionalSynthetics(); }; } // namespace formatters } // namespace lldb_private #endif // liblldb_Cocoa_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/Socket.h
<filename>SymbolExtractorAndRenamer/lldb/include/lldb/Host/Socket.h //===-- Socket.h ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Host_Socket_h_ #define liblldb_Host_Socket_h_ #include <memory> #include <string> #include "lldb/lldb-private.h" #include "lldb/Core/Error.h" #include "lldb/Host/IOObject.h" #include "lldb/Host/Predicate.h" #include "lldb/Host/SocketAddress.h" #ifdef _WIN32 #include "lldb/Host/windows/windows.h" #include <winsock2.h> #include <ws2tcpip.h> #endif namespace llvm { class StringRef; } namespace lldb_private { #if defined(_MSC_VER) typedef SOCKET NativeSocket; #else typedef int NativeSocket; #endif class Socket : public IOObject { public: typedef enum { ProtocolTcp, ProtocolUdp, ProtocolUnixDomain, ProtocolUnixAbstract } SocketProtocol; static const NativeSocket kInvalidSocketValue; ~Socket() override; static std::unique_ptr<Socket> Create(const SocketProtocol protocol, bool child_processes_inherit, Error &error); virtual Error Connect(llvm::StringRef name) = 0; virtual Error Listen(llvm::StringRef name, int backlog) = 0; virtual Error Accept(llvm::StringRef name, bool child_processes_inherit, Socket *&socket) = 0; // Initialize a Tcp Socket object in listening mode. listen and accept are // implemented // separately because the caller may wish to manipulate or query the socket // after it is // initialized, but before entering a blocking accept. static Error TcpListen(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket, Predicate<uint16_t> *predicate, int backlog = 5); static Error TcpConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Error UdpConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Error UnixDomainConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Error UnixDomainAccept(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Error UnixAbstractConnect(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); static Error UnixAbstractAccept(llvm::StringRef host_and_port, bool child_processes_inherit, Socket *&socket); int GetOption(int level, int option_name, int &option_value); int SetOption(int level, int option_name, int option_value); NativeSocket GetNativeSocket() const { return m_socket; } SocketProtocol GetSocketProtocol() const { return m_protocol; } Error Read(void *buf, size_t &num_bytes) override; Error Write(const void *buf, size_t &num_bytes) override; virtual Error PreDisconnect(); Error Close() override; bool IsValid() const override { return m_socket != kInvalidSocketValue; } WaitableHandle GetWaitableHandle() override; static bool DecodeHostAndPort(llvm::StringRef host_and_port, std::string &host_str, std::string &port_str, int32_t &port, Error *error_ptr); protected: Socket(NativeSocket socket, SocketProtocol protocol, bool should_close); virtual size_t Send(const void *buf, const size_t num_bytes); static void SetLastError(Error &error); static NativeSocket CreateSocket(const int domain, const int type, const int protocol, bool child_processes_inherit, Error &error); static NativeSocket AcceptSocket(NativeSocket sockfd, struct sockaddr *addr, socklen_t *addrlen, bool child_processes_inherit, Error &error); SocketProtocol m_protocol; NativeSocket m_socket; }; } // namespace lldb_private #endif // liblldb_Host_Socket_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/ObjectContainer/Universal-Mach-O/ObjectContainerUniversalMachO.h
//===-- ObjectContainerUniversalMachO.h -------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ObjectContainerUniversalMachO_h_ #define liblldb_ObjectContainerUniversalMachO_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Host/FileSpec.h" #include "lldb/Symbol/ObjectContainer.h" #include "lldb/Utility/SafeMachO.h" class ObjectContainerUniversalMachO : public lldb_private::ObjectContainer { public: ObjectContainerUniversalMachO(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t offset, lldb::offset_t length); ~ObjectContainerUniversalMachO() override; //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ static void Initialize(); static void Terminate(); static lldb_private::ConstString GetPluginNameStatic(); static const char *GetPluginDescriptionStatic(); static lldb_private::ObjectContainer * CreateInstance(const lldb::ModuleSP &module_sp, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, const lldb_private::FileSpec *file, lldb::offset_t offset, lldb::offset_t length); static size_t GetModuleSpecifications(const lldb_private::FileSpec &file, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset, lldb::offset_t file_offset, lldb::offset_t length, lldb_private::ModuleSpecList &specs); static bool MagicBytesMatch(const lldb_private::DataExtractor &data); //------------------------------------------------------------------ // Member Functions //------------------------------------------------------------------ bool ParseHeader() override; void Dump(lldb_private::Stream *s) const override; size_t GetNumArchitectures() const override; bool GetArchitectureAtIndex(uint32_t cpu_idx, lldb_private::ArchSpec &arch) const override; lldb::ObjectFileSP GetObjectFile(const lldb_private::FileSpec *file) override; //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; protected: llvm::MachO::fat_header m_header; std::vector<llvm::MachO::fat_arch> m_fat_archs; static bool ParseHeader(lldb_private::DataExtractor &data, llvm::MachO::fat_header &header, std::vector<llvm::MachO::fat_arch> &fat_archs); }; #endif // liblldb_ObjectContainerUniversalMachO_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/Windows/Common/ProcessWindowsLog.h
<gh_stars>100-1000 //===-- ProcessWindowsLog.h -------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ProcessWindowsLog_h_ #define liblldb_ProcessWindowsLog_h_ #include "lldb/Core/Log.h" #define WINDOWS_LOG_VERBOSE (1u << 0) #define WINDOWS_LOG_PROCESS (1u << 1) // Log process operations #define WINDOWS_LOG_EXCEPTION (1u << 1) // Log exceptions #define WINDOWS_LOG_THREAD (1u << 2) // Log thread operations #define WINDOWS_LOG_MEMORY (1u << 3) // Log memory reads/writes calls #define WINDOWS_LOG_BREAKPOINTS (1u << 4) // Log breakpoint operations #define WINDOWS_LOG_STEP (1u << 5) // Log step operations #define WINDOWS_LOG_REGISTERS (1u << 6) // Log register operations #define WINDOWS_LOG_EVENT (1u << 7) // Low level debug events #define WINDOWS_LOG_ALL (UINT32_MAX) enum class LogMaskReq { All, Any }; class ProcessWindowsLog { static const char *m_pluginname; public: // --------------------------------------------------------------------- // Public Static Methods // --------------------------------------------------------------------- static void Initialize(); static void Terminate(); static void RegisterPluginName(const char *pluginName) { m_pluginname = pluginName; } static void RegisterPluginName(lldb_private::ConstString pluginName) { m_pluginname = pluginName.GetCString(); } static bool TestLogFlags(uint32_t mask, LogMaskReq req); static lldb_private::Log *GetLog(); static void DisableLog(const char **args, lldb_private::Stream *feedback_strm); static lldb_private::Log *EnableLog(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **args, lldb_private::Stream *feedback_strm); static void ListLogCategories(lldb_private::Stream *strm); }; #define WINLOGF_IF(Flags, Req, Method, ...) \ { \ if (ProcessWindowsLog::TestLogFlags(Flags, Req)) { \ Log *log = ProcessWindowsLog::GetLog(); \ if (log) \ log->Method(__VA_ARGS__); \ } \ } #define WINLOG_IFANY(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::Any, Printf, __VA_ARGS__) #define WINLOG_IFALL(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::All, Printf, __VA_ARGS__) #define WINLOGV_IFANY(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::Any, Verbose, __VA_ARGS__) #define WINLOGV_IFALL(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::All, Verbose, __VA_ARGS__) #define WINLOGD_IFANY(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::Any, Debug, __VA_ARGS__) #define WINLOGD_IFALL(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::All, Debug, __VA_ARGS__) #define WINERR_IFANY(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::Any, Error, __VA_ARGS__) #define WINERR_IFALL(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::All, Error, __VA_ARGS__) #define WINWARN_IFANY(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::Any, Warning, __VA_ARGS__) #define WINWARN_IFALL(Flags, ...) \ WINLOGF_IF(Flags, LogMaskReq::All, Warning, __VA_ARGS__) #endif // liblldb_ProcessWindowsLog_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/SymbolGenerator.h
#ifndef SymbolGenerator_h #define SymbolGenerator_h #include "swift/Obfuscation/DataStructures.h" #include "swift/Obfuscation/Extractor.h" #include <vector> namespace swift { namespace obfuscation { class SymbolGenerator { public: virtual ~SymbolGenerator() = 0; virtual DeclsWithSymbolsWithRangesOrErrors generateFor(DeclWithRange &) = 0; }; class NominalTypeSymbolGenerator : public SymbolGenerator { private: NominalTypeExtractor Extractor; public: NominalTypeSymbolGenerator(NominalTypeExtractor &); DeclsWithSymbolsWithRangesOrErrors generateFor(DeclWithRange &) override; }; class FunctionNameSymbolGenerator : public SymbolGenerator { private: FunctionExtractor Extractor; SymbolWithRange getFunctionSymbol(const swift::FuncDecl *Declaration, const swift::CharSourceRange &Range); llvm::Expected<SymbolWithRange> parseOverridenDeclaration(const FuncDecl *Declaration, const std::string &ModuleName, const CharSourceRange &Range); public: FunctionNameSymbolGenerator(FunctionExtractor &); DeclsWithSymbolsWithRangesOrErrors generateFor(DeclWithRange &) override; }; class OperatorSymbolGenerator : public SymbolGenerator { private: OperatorExtractor Extractor; public: OperatorSymbolGenerator(OperatorExtractor &); DeclsWithSymbolsWithRangesOrErrors generateFor(DeclWithRange &) override; }; class FunctionParameterSymbolGenerator : public SymbolGenerator { private: FunctionExtractor FuncExtractor; ParameterExtractor ParamExtractor; llvm::Expected<std::string> getIdentifierWithParameterPosition(const ParamDecl *, const AbstractFunctionDecl *); public: FunctionParameterSymbolGenerator(FunctionExtractor &, ParameterExtractor &); DeclsWithSymbolsWithRangesOrErrors generateFor(DeclWithRange &) override; }; class VariableSymbolGenerator : public SymbolGenerator { private: VariableExtractor Extractor; SingleSymbolOrError parseOverridenDeclaration(const VarDecl *Declaration, const std::string &ModuleName); public: VariableSymbolGenerator(VariableExtractor &); DeclsWithSymbolsWithRangesOrErrors generateFor(DeclWithRange &) override; }; } //namespace obfuscation } //namespace swift #endif /* SymbolGenerator_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h
<reponame>Polidea/SiriusObfuscator<filename>SymbolExtractorAndRenamer/lldb/tools/debugserver/source/MacOSX/i386/MachRegisterStatesI386.h<gh_stars>100-1000 //===-- MachRegisterStatesI386.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Created by <NAME> on 3/16/11. // //===----------------------------------------------------------------------===// #ifndef __MachRegisterStatesI386_h__ #define __MachRegisterStatesI386_h__ #include <inttypes.h> #define __i386_THREAD_STATE 1 #define __i386_FLOAT_STATE 2 #define __i386_EXCEPTION_STATE 3 #define __i386_DEBUG_STATE 10 #define __i386_AVX_STATE 16 typedef struct { uint32_t __eax; uint32_t __ebx; uint32_t __ecx; uint32_t __edx; uint32_t __edi; uint32_t __esi; uint32_t __ebp; uint32_t __esp; uint32_t __ss; uint32_t __eflags; uint32_t __eip; uint32_t __cs; uint32_t __ds; uint32_t __es; uint32_t __fs; uint32_t __gs; } __i386_thread_state_t; typedef struct { uint16_t __invalid : 1; uint16_t __denorm : 1; uint16_t __zdiv : 1; uint16_t __ovrfl : 1; uint16_t __undfl : 1; uint16_t __precis : 1; uint16_t __PAD1 : 2; uint16_t __pc : 2; uint16_t __rc : 2; uint16_t __PAD2 : 1; uint16_t __PAD3 : 3; } __i386_fp_control_t; typedef struct { uint16_t __invalid : 1; uint16_t __denorm : 1; uint16_t __zdiv : 1; uint16_t __ovrfl : 1; uint16_t __undfl : 1; uint16_t __precis : 1; uint16_t __stkflt : 1; uint16_t __errsumm : 1; uint16_t __c0 : 1; uint16_t __c1 : 1; uint16_t __c2 : 1; uint16_t __tos : 3; uint16_t __c3 : 1; uint16_t __busy : 1; } __i386_fp_status_t; typedef struct { uint8_t __mmst_reg[10]; uint8_t __mmst_rsrv[6]; } __i386_mmst_reg; typedef struct { uint8_t __xmm_reg[16]; } __i386_xmm_reg; typedef struct { uint32_t __fpu_reserved[2]; __i386_fp_control_t __fpu_fcw; __i386_fp_status_t __fpu_fsw; uint8_t __fpu_ftw; uint8_t __fpu_rsrv1; uint16_t __fpu_fop; uint32_t __fpu_ip; uint16_t __fpu_cs; uint16_t __fpu_rsrv2; uint32_t __fpu_dp; uint16_t __fpu_ds; uint16_t __fpu_rsrv3; uint32_t __fpu_mxcsr; uint32_t __fpu_mxcsrmask; __i386_mmst_reg __fpu_stmm0; __i386_mmst_reg __fpu_stmm1; __i386_mmst_reg __fpu_stmm2; __i386_mmst_reg __fpu_stmm3; __i386_mmst_reg __fpu_stmm4; __i386_mmst_reg __fpu_stmm5; __i386_mmst_reg __fpu_stmm6; __i386_mmst_reg __fpu_stmm7; __i386_xmm_reg __fpu_xmm0; __i386_xmm_reg __fpu_xmm1; __i386_xmm_reg __fpu_xmm2; __i386_xmm_reg __fpu_xmm3; __i386_xmm_reg __fpu_xmm4; __i386_xmm_reg __fpu_xmm5; __i386_xmm_reg __fpu_xmm6; __i386_xmm_reg __fpu_xmm7; uint8_t __fpu_rsrv4[14 * 16]; uint32_t __fpu_reserved1; } __i386_float_state_t; typedef struct { uint32_t __fpu_reserved[2]; __i386_fp_control_t __fpu_fcw; __i386_fp_status_t __fpu_fsw; uint8_t __fpu_ftw; uint8_t __fpu_rsrv1; uint16_t __fpu_fop; uint32_t __fpu_ip; uint16_t __fpu_cs; uint16_t __fpu_rsrv2; uint32_t __fpu_dp; uint16_t __fpu_ds; uint16_t __fpu_rsrv3; uint32_t __fpu_mxcsr; uint32_t __fpu_mxcsrmask; __i386_mmst_reg __fpu_stmm0; __i386_mmst_reg __fpu_stmm1; __i386_mmst_reg __fpu_stmm2; __i386_mmst_reg __fpu_stmm3; __i386_mmst_reg __fpu_stmm4; __i386_mmst_reg __fpu_stmm5; __i386_mmst_reg __fpu_stmm6; __i386_mmst_reg __fpu_stmm7; __i386_xmm_reg __fpu_xmm0; __i386_xmm_reg __fpu_xmm1; __i386_xmm_reg __fpu_xmm2; __i386_xmm_reg __fpu_xmm3; __i386_xmm_reg __fpu_xmm4; __i386_xmm_reg __fpu_xmm5; __i386_xmm_reg __fpu_xmm6; __i386_xmm_reg __fpu_xmm7; uint8_t __fpu_rsrv4[14 * 16]; uint32_t __fpu_reserved1; uint8_t __avx_reserved1[64]; __i386_xmm_reg __fpu_ymmh0; __i386_xmm_reg __fpu_ymmh1; __i386_xmm_reg __fpu_ymmh2; __i386_xmm_reg __fpu_ymmh3; __i386_xmm_reg __fpu_ymmh4; __i386_xmm_reg __fpu_ymmh5; __i386_xmm_reg __fpu_ymmh6; __i386_xmm_reg __fpu_ymmh7; } __i386_avx_state_t; typedef struct { uint32_t __trapno; uint32_t __err; uint32_t __faultvaddr; } __i386_exception_state_t; typedef struct { uint32_t __dr0; uint32_t __dr1; uint32_t __dr2; uint32_t __dr3; uint32_t __dr4; uint32_t __dr5; uint32_t __dr6; uint32_t __dr7; } __i386_debug_state_t; #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/tools/debugserver/source/MacOSX/i386/DNBArchImplI386.h
<reponame>Polidea/SiriusObfuscator //===-- DNBArchImplI386.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Created by <NAME> on 6/25/07. // //===----------------------------------------------------------------------===// #ifndef __DNBArchImplI386_h__ #define __DNBArchImplI386_h__ #if defined(__i386__) || defined(__x86_64__) #include "DNBArch.h" #include "MachRegisterStatesI386.h" #include <map> class MachThread; class DNBArchImplI386 : public DNBArchProtocol { public: DNBArchImplI386(MachThread *thread) : DNBArchProtocol(), m_thread(thread), m_state(), m_2pc_dbg_checkpoint(), m_2pc_trans_state(Trans_Done), m_saved_register_states() {} virtual ~DNBArchImplI386() {} static void Initialize(); virtual bool GetRegisterValue(uint32_t set, uint32_t reg, DNBRegisterValue *value); virtual bool SetRegisterValue(uint32_t set, uint32_t reg, const DNBRegisterValue *value); virtual nub_size_t GetRegisterContext(void *buf, nub_size_t buf_len); virtual nub_size_t SetRegisterContext(const void *buf, nub_size_t buf_len); virtual uint32_t SaveRegisterState(); virtual bool RestoreRegisterState(uint32_t save_id); virtual kern_return_t GetRegisterState(int set, bool force); virtual kern_return_t SetRegisterState(int set); virtual bool RegisterSetStateIsValid(int set) const; virtual uint64_t GetPC(uint64_t failValue); // Get program counter virtual kern_return_t SetPC(uint64_t value); virtual uint64_t GetSP(uint64_t failValue); // Get stack pointer virtual void ThreadWillResume(); virtual bool ThreadDidStop(); virtual bool NotifyException(MachException::Data &exc); virtual uint32_t NumSupportedHardwareWatchpoints(); virtual uint32_t EnableHardwareWatchpoint(nub_addr_t addr, nub_size_t size, bool read, bool write, bool also_set_on_task); virtual bool DisableHardwareWatchpoint(uint32_t hw_break_index, bool also_set_on_task); virtual uint32_t GetHardwareWatchpointHit(nub_addr_t &addr); protected: kern_return_t EnableHardwareSingleStep(bool enable); typedef __i386_thread_state_t GPR; typedef __i386_float_state_t FPU; typedef __i386_exception_state_t EXC; typedef __i386_avx_state_t AVX; typedef __i386_debug_state_t DBG; static const DNBRegisterInfo g_gpr_registers[]; static const DNBRegisterInfo g_fpu_registers_no_avx[]; static const DNBRegisterInfo g_fpu_registers_avx[]; static const DNBRegisterInfo g_exc_registers[]; static const DNBRegisterSetInfo g_reg_sets_no_avx[]; static const DNBRegisterSetInfo g_reg_sets_avx[]; static const size_t k_num_gpr_registers; static const size_t k_num_fpu_registers_no_avx; static const size_t k_num_fpu_registers_avx; static const size_t k_num_exc_registers; static const size_t k_num_all_registers_no_avx; static const size_t k_num_all_registers_avx; static const size_t k_num_register_sets; typedef enum RegisterSetTag { e_regSetALL = REGISTER_SET_ALL, e_regSetGPR, e_regSetFPU, e_regSetEXC, e_regSetDBG, kNumRegisterSets } RegisterSet; typedef enum RegisterSetWordSizeTag { e_regSetWordSizeGPR = sizeof(GPR) / sizeof(int), e_regSetWordSizeFPU = sizeof(FPU) / sizeof(int), e_regSetWordSizeEXC = sizeof(EXC) / sizeof(int), e_regSetWordSizeAVX = sizeof(AVX) / sizeof(int), e_regSetWordSizeDBG = sizeof(DBG) / sizeof(int) } RegisterSetWordSize; enum { Read = 0, Write = 1, kNumErrors = 2 }; struct Context { GPR gpr; union { FPU no_avx; AVX avx; } fpu; EXC exc; DBG dbg; }; struct State { Context context; kern_return_t gpr_errs[2]; // Read/Write errors kern_return_t fpu_errs[2]; // Read/Write errors kern_return_t exc_errs[2]; // Read/Write errors kern_return_t dbg_errs[2]; // Read/Write errors State() { uint32_t i; for (i = 0; i < kNumErrors; i++) { gpr_errs[i] = -1; fpu_errs[i] = -1; exc_errs[i] = -1; dbg_errs[i] = -1; } } void InvalidateAllRegisterStates() { SetError(e_regSetALL, Read, -1); } kern_return_t GetError(int flavor, uint32_t err_idx) const { if (err_idx < kNumErrors) { switch (flavor) { // When getting all errors, just OR all values together to see if // we got any kind of error. case e_regSetALL: return gpr_errs[err_idx] | fpu_errs[err_idx] | exc_errs[err_idx]; case e_regSetGPR: return gpr_errs[err_idx]; case e_regSetFPU: return fpu_errs[err_idx]; case e_regSetEXC: return exc_errs[err_idx]; case e_regSetDBG: return dbg_errs[err_idx]; default: break; } } return -1; } bool SetError(int flavor, uint32_t err_idx, kern_return_t err) { if (err_idx < kNumErrors) { switch (flavor) { case e_regSetALL: gpr_errs[err_idx] = fpu_errs[err_idx] = exc_errs[err_idx] = dbg_errs[err_idx] = err; return true; case e_regSetGPR: gpr_errs[err_idx] = err; return true; case e_regSetFPU: fpu_errs[err_idx] = err; return true; case e_regSetEXC: exc_errs[err_idx] = err; return true; case e_regSetDBG: dbg_errs[err_idx] = err; return true; default: break; } } return false; } bool RegsAreValid(int flavor) const { return GetError(flavor, Read) == KERN_SUCCESS; } }; kern_return_t GetGPRState(bool force); kern_return_t GetFPUState(bool force); kern_return_t GetEXCState(bool force); kern_return_t GetDBGState(bool force); kern_return_t SetGPRState(); kern_return_t SetFPUState(); kern_return_t SetEXCState(); kern_return_t SetDBGState(bool also_set_on_task); static DNBArchProtocol *Create(MachThread *thread); static const uint8_t *SoftwareBreakpointOpcode(nub_size_t byte_size); static const DNBRegisterSetInfo *GetRegisterSetInfo(nub_size_t *num_reg_sets); static uint32_t GetRegisterContextSize(); // Helper functions for watchpoint manipulations. static void SetWatchpoint(DBG &debug_state, uint32_t hw_index, nub_addr_t addr, nub_size_t size, bool read, bool write); static void ClearWatchpoint(DBG &debug_state, uint32_t hw_index); static bool IsWatchpointVacant(const DBG &debug_state, uint32_t hw_index); static void ClearWatchpointHits(DBG &debug_state); static bool IsWatchpointHit(const DBG &debug_state, uint32_t hw_index); static nub_addr_t GetWatchAddress(const DBG &debug_state, uint32_t hw_index); virtual bool StartTransForHWP(); virtual bool RollbackTransForHWP(); virtual bool FinishTransForHWP(); DBG GetDBGCheckpoint(); MachThread *m_thread; State m_state; DBG m_2pc_dbg_checkpoint; uint32_t m_2pc_trans_state; // Is transaction of DBG state change: Pedning // (0), Done (1), or Rolled Back (2)? typedef std::map<uint32_t, Context> SaveRegisterStates; SaveRegisterStates m_saved_register_states; }; #endif // #if defined (__i386__) || defined (__x86_64__) #endif // #ifndef __DNBArchImplI386_h__
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h
<filename>SymbolExtractorAndRenamer/lldb/source/Plugins/ScriptInterpreter/None/ScriptInterpreterNone.h //===-- ScriptInterpreterNone.h ---------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ScriptInterpreterNone_h_ #define liblldb_ScriptInterpreterNone_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Interpreter/ScriptInterpreter.h" namespace lldb_private { class ScriptInterpreterNone : public ScriptInterpreter { public: ScriptInterpreterNone(CommandInterpreter &interpreter); ~ScriptInterpreterNone() override; bool ExecuteOneLine( const char *command, CommandReturnObject *result, const ExecuteScriptOptions &options = ExecuteScriptOptions()) override; void ExecuteInterpreterLoop() override; //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ static void Initialize(); static void Terminate(); static lldb::ScriptInterpreterSP CreateInstance(CommandInterpreter &interpreter); static lldb_private::ConstString GetPluginNameStatic(); static const char *GetPluginDescriptionStatic(); //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; }; } // namespace lldb_private #endif // liblldb_ScriptInterpreterNone_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/APINotes/yaml-roundtrip.c
<gh_stars>100-1000 # RUN: %clang -cc1apinotes -yaml-to-binary -o %t.apinotesc %S/Inputs/roundtrip.apinotes # RUN: %clang -cc1apinotes -binary-to-yaml -o %t.apinotes %t.apinotesc # Handle the infurating '...' the YAML writer adds but the parser # can't read. # RUN: cp %S/Inputs/roundtrip.apinotes %t-reference.apinotes # RUN: echo "..." >> %t-reference.apinotes # RUN: diff %t-reference.apinotes %t.apinotes
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/unittests/Process/gdb-remote/GDBRemoteTestUtils.h
//===-- GDBRemoteTestUtils.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef lldb_unittests_Process_gdb_remote_GDBRemoteTestUtils_h #define lldb_unittests_Process_gdb_remote_GDBRemoteTestUtils_h #include "gtest/gtest.h" #include "Plugins/Process/gdb-remote/GDBRemoteCommunicationServer.h" namespace lldb_private { namespace process_gdb_remote { class GDBRemoteTest : public testing::Test { public: static void SetUpTestCase(); static void TearDownTestCase(); }; void Connect(GDBRemoteCommunication &client, GDBRemoteCommunication &server); struct MockServer : public GDBRemoteCommunicationServer { MockServer() : GDBRemoteCommunicationServer("mock-server", "mock-server.listener") { m_send_acks = false; } PacketResult SendPacket(llvm::StringRef payload) { return GDBRemoteCommunicationServer::SendPacketNoLock(payload); } PacketResult GetPacket(StringExtractorGDBRemote &response) { const bool sync_on_timeout = false; return WaitForPacketNoLock(response, std::chrono::seconds(1), sync_on_timeout); } using GDBRemoteCommunicationServer::SendOKResponse; using GDBRemoteCommunicationServer::SendUnimplementedResponse; }; } // namespace process_gdb_remote } // namespace lldb_private #endif // lldb_unittests_Process_gdb_remote_GDBRemoteTestUtils_h
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/Log.h
<filename>SymbolExtractorAndRenamer/lldb/include/lldb/Core/Log.h<gh_stars>100-1000 //===-- Log.h ---------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Log_h_ #define liblldb_Log_h_ // C Includes #include <signal.h> #include <stdarg.h> #include <stdint.h> #include <stdio.h> // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Core/ConstString.h" #include "lldb/Core/Flags.h" #include "lldb/Core/Logging.h" #include "lldb/Core/PluginInterface.h" #include "lldb/lldb-private.h" #include "llvm/Support/FormatVariadic.h" //---------------------------------------------------------------------- // Logging Options //---------------------------------------------------------------------- #define LLDB_LOG_OPTION_THREADSAFE (1u << 0) #define LLDB_LOG_OPTION_VERBOSE (1u << 1) #define LLDB_LOG_OPTION_DEBUG (1u << 2) #define LLDB_LOG_OPTION_PREPEND_SEQUENCE (1u << 3) #define LLDB_LOG_OPTION_PREPEND_TIMESTAMP (1u << 4) #define LLDB_LOG_OPTION_PREPEND_PROC_AND_THREAD (1u << 5) #define LLDB_LOG_OPTION_PREPEND_THREAD_NAME (1U << 6) #define LLDB_LOG_OPTION_BACKTRACE (1U << 7) #define LLDB_LOG_OPTION_APPEND (1U << 8) //---------------------------------------------------------------------- // Logging Functions //---------------------------------------------------------------------- namespace lldb_private { class Log final { public: //------------------------------------------------------------------ // Callback definitions for abstracted plug-in log access. //------------------------------------------------------------------ typedef void (*DisableCallback)(const char **categories, Stream *feedback_strm); typedef Log *(*EnableCallback)(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm); typedef void (*ListCategoriesCallback)(Stream *strm); struct Callbacks { DisableCallback disable; EnableCallback enable; ListCategoriesCallback list_categories; }; //------------------------------------------------------------------ // Static accessors for logging channels //------------------------------------------------------------------ static void RegisterLogChannel(const ConstString &channel, const Log::Callbacks &log_callbacks); static bool UnregisterLogChannel(const ConstString &channel); static bool GetLogChannelCallbacks(const ConstString &channel, Log::Callbacks &log_callbacks); static bool EnableLogChannel(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char *channel, const char **categories, Stream &error_stream); static void EnableAllLogChannels(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **categories, Stream *feedback_strm); static void DisableAllLogChannels(Stream *feedback_strm); static void ListAllLogChannels(Stream *strm); static void Initialize(); static void Terminate(); //------------------------------------------------------------------ // Auto completion //------------------------------------------------------------------ static void AutoCompleteChannelName(const char *channel_name, StringList &matches); //------------------------------------------------------------------ // Member functions //------------------------------------------------------------------ Log(); Log(const lldb::StreamSP &stream_sp); ~Log(); void PutCString(const char *cstr); void PutString(llvm::StringRef str); template <typename... Args> void Format(const char *fmt, Args &&... args) { PutString(llvm::formatv(fmt, std::forward<Args>(args)...).str()); } // CLEANUP: Add llvm::raw_ostream &Stream() function. void Printf(const char *format, ...) __attribute__((format(printf, 2, 3))); void VAPrintf(const char *format, va_list args); void LogIf(uint32_t mask, const char *fmt, ...) __attribute__((format(printf, 3, 4))); void Debug(const char *fmt, ...) __attribute__((format(printf, 2, 3))); void Error(const char *fmt, ...) __attribute__((format(printf, 2, 3))); void VAError(const char *format, va_list args); void Verbose(const char *fmt, ...) __attribute__((format(printf, 2, 3))); void Warning(const char *fmt, ...) __attribute__((format(printf, 2, 3))); Flags &GetOptions(); const Flags &GetOptions() const; Flags &GetMask(); const Flags &GetMask() const; bool GetVerbose() const; bool GetDebug() const; void SetStream(const lldb::StreamSP &stream_sp) { m_stream_sp = stream_sp; } protected: //------------------------------------------------------------------ // Member variables //------------------------------------------------------------------ lldb::StreamSP m_stream_sp; Flags m_options; Flags m_mask_bits; private: DISALLOW_COPY_AND_ASSIGN(Log); }; class LogChannel : public PluginInterface { public: LogChannel(); ~LogChannel() override; static lldb::LogChannelSP FindPlugin(const char *plugin_name); // categories is an array of chars that ends with a NULL element. virtual void Disable(const char **categories, Stream *feedback_strm) = 0; virtual bool Enable(lldb::StreamSP &log_stream_sp, uint32_t log_options, Stream *feedback_strm, // Feedback stream for argument errors etc const char **categories) = 0; // The categories to enable within this // logging stream, if empty, enable // default set virtual void ListCategories(Stream *strm) = 0; protected: std::unique_ptr<Log> m_log_ap; private: DISALLOW_COPY_AND_ASSIGN(LogChannel); }; } // namespace lldb_private #endif // liblldb_Log_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/StructuredData.h
<reponame>Polidea/SiriusObfuscator //===-- StructuredData.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_StructuredData_h_ #define liblldb_StructuredData_h_ // C Includes // C++ Includes #include <functional> #include <map> #include <memory> #include <string> #include <utility> #include <vector> // Other libraries and framework includes #include "llvm/ADT/StringRef.h" // Project includes #include "lldb/Core/ConstString.h" #include "lldb/Core/Stream.h" #include "lldb/lldb-defines.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class StructuredData StructuredData.h "lldb/Core/StructuredData.h" /// @brief A class which can hold structured data /// /// The StructuredData class is designed to hold the data from a JSON /// or plist style file -- a serialized data structure with dictionaries /// (maps, hashes), arrays, and concrete values like integers, floating /// point numbers, strings, booleans. /// /// StructuredData does not presuppose any knowledge of the schema for /// the data it is holding; it can parse JSON data, for instance, and /// other parts of lldb can iterate through the parsed data set to find /// keys and values that may be present. //---------------------------------------------------------------------- class StructuredData { public: class Object; class Array; class Integer; class Float; class Boolean; class String; class Dictionary; class Generic; typedef std::shared_ptr<Object> ObjectSP; typedef std::shared_ptr<Array> ArraySP; typedef std::shared_ptr<Integer> IntegerSP; typedef std::shared_ptr<Float> FloatSP; typedef std::shared_ptr<Boolean> BooleanSP; typedef std::shared_ptr<String> StringSP; typedef std::shared_ptr<Dictionary> DictionarySP; typedef std::shared_ptr<Generic> GenericSP; enum class Type { eTypeInvalid = -1, eTypeNull = 0, eTypeGeneric, eTypeArray, eTypeInteger, eTypeFloat, eTypeBoolean, eTypeString, eTypeDictionary }; class Object : public std::enable_shared_from_this<Object> { public: Object(Type t = Type::eTypeInvalid) : m_type(t) {} virtual ~Object() = default; virtual bool IsValid() const { return true; } virtual void Clear() { m_type = Type::eTypeInvalid; } Type GetType() const { return m_type; } void SetType(Type t) { m_type = t; } Array *GetAsArray() { return ((m_type == Type::eTypeArray) ? static_cast<Array *>(this) : nullptr); } Dictionary *GetAsDictionary() { return ((m_type == Type::eTypeDictionary) ? static_cast<Dictionary *>(this) : nullptr); } Integer *GetAsInteger() { return ((m_type == Type::eTypeInteger) ? static_cast<Integer *>(this) : nullptr); } uint64_t GetIntegerValue(uint64_t fail_value = 0) { Integer *integer = GetAsInteger(); return ((integer != nullptr) ? integer->GetValue() : fail_value); } Float *GetAsFloat() { return ((m_type == Type::eTypeFloat) ? static_cast<Float *>(this) : nullptr); } double GetFloatValue(double fail_value = 0.0) { Float *f = GetAsFloat(); return ((f != nullptr) ? f->GetValue() : fail_value); } Boolean *GetAsBoolean() { return ((m_type == Type::eTypeBoolean) ? static_cast<Boolean *>(this) : nullptr); } bool GetBooleanValue(bool fail_value = false) { Boolean *b = GetAsBoolean(); return ((b != nullptr) ? b->GetValue() : fail_value); } String *GetAsString() { return ((m_type == Type::eTypeString) ? static_cast<String *>(this) : nullptr); } std::string GetStringValue(const char *fail_value = nullptr) { String *s = GetAsString(); if (s) return s->GetValue(); if (fail_value && fail_value[0]) return std::string(fail_value); return std::string(); } Generic *GetAsGeneric() { return ((m_type == Type::eTypeGeneric) ? static_cast<Generic *>(this) : nullptr); } ObjectSP GetObjectForDotSeparatedPath(llvm::StringRef path); void DumpToStdout(bool pretty_print = true) const; virtual void Dump(Stream &s, bool pretty_print = true) const = 0; private: Type m_type; }; class Array : public Object { public: Array() : Object(Type::eTypeArray) {} ~Array() override = default; bool ForEach(std::function<bool(Object *object)> const &foreach_callback) const { for (const auto &object_sp : m_items) { if (foreach_callback(object_sp.get()) == false) return false; } return true; } size_t GetSize() const { return m_items.size(); } ObjectSP operator[](size_t idx) { if (idx < m_items.size()) return m_items[idx]; return ObjectSP(); } ObjectSP GetItemAtIndex(size_t idx) const { assert(idx < GetSize()); if (idx < m_items.size()) return m_items[idx]; return ObjectSP(); } template <class IntType> bool GetItemAtIndexAsInteger(size_t idx, IntType &result) const { ObjectSP value_sp = GetItemAtIndex(idx); if (value_sp.get()) { if (auto int_value = value_sp->GetAsInteger()) { result = static_cast<IntType>(int_value->GetValue()); return true; } } return false; } template <class IntType> bool GetItemAtIndexAsInteger(size_t idx, IntType &result, IntType default_val) const { bool success = GetItemAtIndexAsInteger(idx, result); if (!success) result = default_val; return success; } bool GetItemAtIndexAsString(size_t idx, std::string &result) const { ObjectSP value_sp = GetItemAtIndex(idx); if (value_sp.get()) { if (auto string_value = value_sp->GetAsString()) { result = string_value->GetValue(); return true; } } return false; } bool GetItemAtIndexAsString(size_t idx, std::string &result, const std::string &default_val) const { bool success = GetItemAtIndexAsString(idx, result); if (!success) result = default_val; return success; } bool GetItemAtIndexAsString(size_t idx, ConstString &result) const { ObjectSP value_sp = GetItemAtIndex(idx); if (value_sp.get()) { if (auto string_value = value_sp->GetAsString()) { result = ConstString(string_value->GetValue()); return true; } } return false; } bool GetItemAtIndexAsString(size_t idx, ConstString &result, const char *default_val) const { bool success = GetItemAtIndexAsString(idx, result); if (!success) result.SetCString(default_val); return success; } bool GetItemAtIndexAsDictionary(size_t idx, Dictionary *&result) const { result = nullptr; ObjectSP value_sp = GetItemAtIndex(idx); if (value_sp.get()) { result = value_sp->GetAsDictionary(); return (result != nullptr); } return false; } bool GetItemAtIndexAsArray(size_t idx, Array *&result) const { result = nullptr; ObjectSP value_sp = GetItemAtIndex(idx); if (value_sp.get()) { result = value_sp->GetAsArray(); return (result != nullptr); } return false; } void Push(ObjectSP item) { m_items.push_back(item); } void AddItem(ObjectSP item) { m_items.push_back(item); } void Dump(Stream &s, bool pretty_print = true) const override; protected: typedef std::vector<ObjectSP> collection; collection m_items; }; class Integer : public Object { public: Integer(uint64_t i = 0) : Object(Type::eTypeInteger), m_value(i) {} ~Integer() override = default; void SetValue(uint64_t value) { m_value = value; } uint64_t GetValue() { return m_value; } void Dump(Stream &s, bool pretty_print = true) const override; protected: uint64_t m_value; }; class Float : public Object { public: Float(double d = 0.0) : Object(Type::eTypeFloat), m_value(d) {} ~Float() override = default; void SetValue(double value) { m_value = value; } double GetValue() { return m_value; } void Dump(Stream &s, bool pretty_print = true) const override; protected: double m_value; }; class Boolean : public Object { public: Boolean(bool b = false) : Object(Type::eTypeBoolean), m_value(b) {} ~Boolean() override = default; void SetValue(bool value) { m_value = value; } bool GetValue() { return m_value; } void Dump(Stream &s, bool pretty_print = true) const override; protected: bool m_value; }; class String : public Object { public: String(const char *cstr = nullptr) : Object(Type::eTypeString), m_value() { if (cstr) m_value = cstr; } String(const std::string &s) : Object(Type::eTypeString), m_value(s) {} String(const std::string &&s) : Object(Type::eTypeString), m_value(s) {} void SetValue(const std::string &string) { m_value = string; } const std::string &GetValue() { return m_value; } void Dump(Stream &s, bool pretty_print = true) const override; protected: std::string m_value; }; class Dictionary : public Object { public: Dictionary() : Object(Type::eTypeDictionary), m_dict() {} ~Dictionary() override = default; size_t GetSize() const { return m_dict.size(); } void ForEach(std::function<bool(ConstString key, Object *object)> const &callback) const { for (const auto &pair : m_dict) { if (callback(pair.first, pair.second.get()) == false) break; } } ObjectSP GetKeys() const { ObjectSP object_sp(new Array()); Array *array = object_sp->GetAsArray(); collection::const_iterator iter; for (iter = m_dict.begin(); iter != m_dict.end(); ++iter) { ObjectSP key_object_sp(new String()); key_object_sp->GetAsString()->SetValue(iter->first.AsCString()); array->Push(key_object_sp); } return object_sp; } ObjectSP GetValueForKey(llvm::StringRef key) const { ObjectSP value_sp; if (!key.empty()) { ConstString key_cs(key); collection::const_iterator iter = m_dict.find(key_cs); if (iter != m_dict.end()) value_sp = iter->second; } return value_sp; } bool GetValueForKeyAsBoolean(llvm::StringRef key, bool &result) const { bool success = false; ObjectSP value_sp = GetValueForKey(key); if (value_sp.get()) { Boolean *result_ptr = value_sp->GetAsBoolean(); if (result_ptr) { result = result_ptr->GetValue(); success = true; } } return success; } template <class IntType> bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result) const { ObjectSP value_sp = GetValueForKey(key); if (value_sp) { if (auto int_value = value_sp->GetAsInteger()) { result = static_cast<IntType>(int_value->GetValue()); return true; } } return false; } template <class IntType> bool GetValueForKeyAsInteger(llvm::StringRef key, IntType &result, IntType default_val) const { bool success = GetValueForKeyAsInteger<IntType>(key, result); if (!success) result = default_val; return success; } bool GetValueForKeyAsString(llvm::StringRef key, std::string &result) const { ObjectSP value_sp = GetValueForKey(key); if (value_sp.get()) { if (auto string_value = value_sp->GetAsString()) { result = string_value->GetValue(); return true; } } return false; } bool GetValueForKeyAsString(llvm::StringRef key, std::string &result, const char *default_val) const { bool success = GetValueForKeyAsString(key, result); if (!success) { if (default_val) result = default_val; else result.clear(); } return success; } bool GetValueForKeyAsString(llvm::StringRef key, ConstString &result) const { ObjectSP value_sp = GetValueForKey(key); if (value_sp.get()) { if (auto string_value = value_sp->GetAsString()) { result = ConstString(string_value->GetValue()); return true; } } return false; } bool GetValueForKeyAsString(llvm::StringRef key, ConstString &result, const char *default_val) const { bool success = GetValueForKeyAsString(key, result); if (!success) result.SetCString(default_val); return success; } bool GetValueForKeyAsDictionary(llvm::StringRef key, Dictionary *&result) const { result = nullptr; ObjectSP value_sp = GetValueForKey(key); if (value_sp.get()) { result = value_sp->GetAsDictionary(); return (result != nullptr); } return false; } bool GetValueForKeyAsArray(llvm::StringRef key, Array *&result) const { result = nullptr; ObjectSP value_sp = GetValueForKey(key); if (value_sp.get()) { result = value_sp->GetAsArray(); return (result != nullptr); } return false; } bool HasKey(llvm::StringRef key) const { ConstString key_cs(key); collection::const_iterator search = m_dict.find(key_cs); return search != m_dict.end(); } void AddItem(llvm::StringRef key, ObjectSP value_sp) { ConstString key_cs(key); m_dict[key_cs] = value_sp; } void AddIntegerItem(llvm::StringRef key, uint64_t value) { AddItem(key, ObjectSP(new Integer(value))); } void AddFloatItem(llvm::StringRef key, double value) { AddItem(key, ObjectSP(new Float(value))); } void AddStringItem(llvm::StringRef key, std::string value) { AddItem(key, ObjectSP(new String(std::move(value)))); } void AddBooleanItem(llvm::StringRef key, bool value) { AddItem(key, ObjectSP(new Boolean(value))); } void Dump(Stream &s, bool pretty_print = true) const override; protected: typedef std::map<ConstString, ObjectSP> collection; collection m_dict; }; class Null : public Object { public: Null() : Object(Type::eTypeNull) {} ~Null() override = default; bool IsValid() const override { return false; } void Dump(Stream &s, bool pretty_print = true) const override; }; class Generic : public Object { public: explicit Generic(void *object = nullptr) : Object(Type::eTypeGeneric), m_object(object) {} void SetValue(void *value) { m_object = value; } void *GetValue() const { return m_object; } bool IsValid() const override { return m_object != nullptr; } void Dump(Stream &s, bool pretty_print = true) const override; private: void *m_object; }; static ObjectSP ParseJSON(std::string json_text); static ObjectSP ParseJSONFromFile(const FileSpec &file, Error &error); }; } // namespace lldb_private #endif // liblldb_StructuredData_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Target/ThreadPlanPython.h
//===-- ThreadPlanPython.h --------------------------------------------*- C++ //-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ThreadPlan_Python_h_ #define liblldb_ThreadPlan_Python_h_ // C Includes // C++ Includes #include <string> // Other libraries and framework includes // Project includes #include "lldb/Core/StructuredData.h" #include "lldb/Core/UserID.h" #include "lldb/Target/Process.h" #include "lldb/Target/StopInfo.h" #include "lldb/Target/Target.h" #include "lldb/Target/Thread.h" #include "lldb/Target/ThreadPlan.h" #include "lldb/Target/ThreadPlanTracer.h" #include "lldb/lldb-private.h" namespace lldb_private { //------------------------------------------------------------------ // ThreadPlanPython: // //------------------------------------------------------------------ class ThreadPlanPython : public ThreadPlan { public: ThreadPlanPython(Thread &thread, const char *class_name); ~ThreadPlanPython() override; void GetDescription(Stream *s, lldb::DescriptionLevel level) override; bool ValidatePlan(Stream *error) override; bool ShouldStop(Event *event_ptr) override; bool MischiefManaged() override; bool WillStop() override; bool StopOthers() override; void DidPush() override; bool IsPlanStale() override; protected: bool DoPlanExplainsStop(Event *event_ptr) override; lldb::StateType GetPlanRunState() override; private: std::string m_class_name; StructuredData::ObjectSP m_implementation_sp; DISALLOW_COPY_AND_ASSIGN(ThreadPlanPython); }; } // namespace lldb_private #endif // liblldb_ThreadPlan_Python_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/FileIO-Template.h
<filename>SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/FileIO-Template.h #ifndef FileIOTemplate_h #define FileIOTemplate_h #include "llvm/Support/Error.h" #include "llvm/Support/MemoryBuffer.h" #include "llvm/Support/FileSystem.h" #include "swift/Obfuscation/DataStructures.h" #include "swift/Obfuscation/Utils.h" #include <string> namespace swift { namespace obfuscation { template<class FileType> llvm::ErrorOr<std::unique_ptr<FileType>> FileFactory<FileType>::getFile(std::string Path) { std::error_code Error; auto File = llvm::make_unique<FileType>(Path, Error, llvm::sys::fs::F_None); if (Error) { return Error; } return File; } template<class T, typename FileType> llvm::Error writeToPath(T &Object, std::string PathToOutput, FileFactory<FileType> Factory, llvm::raw_ostream &LogStream) { std::error_code Error; auto File = Factory.getFile(PathToOutput); if (auto FileError = File.getError()) { return stringError("Failed to open file: " + PathToOutput, FileError); } return writeToFile(Object, LogStream, std::move(File.get())); } template<typename T, typename FileType> llvm::Error writeToFile(T &Object, llvm::raw_ostream &LogStream, std::unique_ptr<FileType> File) { auto SerializedObject = json::serialize(Object); *File << SerializedObject; File->close(); LogStream << "Written to file: " << '\n' << SerializedObject << '\n'; return llvm::Error::success(); } } //namespace obfuscation } //namespace swift #endif /* FileIOTemplate_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/Timer.h
//===-- Timer.h -------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Timer_h_ #define liblldb_Timer_h_ // C Includes #include <stdarg.h> #include <stdio.h> // C++ Includes #include <atomic> #include <mutex> // Other libraries and framework includes // Project includes #include "lldb/lldb-private.h" #include "llvm/Support/Chrono.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class Timer Timer.h "lldb/Core/Timer.h" /// @brief A timer class that simplifies common timing metrics. /// /// A scoped timer class that allows a variety of pthread mutex /// objects to have a mutex locked when a Timer::Locker /// object is created, and unlocked when it goes out of scope or /// when the Timer::Locker::Reset(pthread_mutex_t *) /// is called. This provides an exception safe way to lock a mutex /// in a scope. //---------------------------------------------------------------------- class Timer { public: //-------------------------------------------------------------- /// Default constructor. //-------------------------------------------------------------- Timer(const char *category, const char *format, ...) __attribute__((format(printf, 3, 4))); //-------------------------------------------------------------- /// Destructor //-------------------------------------------------------------- ~Timer(); void Dump(); static void SetDisplayDepth(uint32_t depth); static void SetQuiet(bool value); static void DumpCategoryTimes(Stream *s); static void ResetCategoryTimes(); protected: using TimePoint = std::chrono::steady_clock::time_point; void ChildDuration(TimePoint::duration dur) { m_child_duration += dur; } const char *m_category; TimePoint m_total_start; TimePoint::duration m_child_duration{0}; static std::atomic<bool> g_quiet; static std::atomic<unsigned> g_display_depth; private: DISALLOW_COPY_AND_ASSIGN(Timer); }; } // namespace lldb_private #endif // liblldb_Timer_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Index/Store/json.c
<gh_stars>100-1000 // RUN: rm -rf %t.idx // RUN: mkdir -p %t.o // RUN: env CLANG_PROJECT_INDEX_PATH=%t.idx %clang -target x86_64-apple-macosx10.7 -arch x86_64 -mmacosx-version-min=10.7 -c %S/Inputs/test1.c -o %t.o/test1.o // RUN: env CLANG_PROJECT_INDEX_PATH=%t.idx %clang -target x86_64-apple-macosx10.7 -arch x86_64 -mmacosx-version-min=10.7 -c %S/Inputs/test2.c -o %t.o/test2.o // RUN: env CLANG_PROJECT_INDEX_PATH=%t.idx %clang -target x86_64-apple-macosx10.7 -arch x86_64 -mmacosx-version-min=10.7 -c %S/Inputs/test3.cpp -o %t.o/test3.o // RUN: c-index-test core -aggregate-json %t.idx -o %t.json // RUN: sed -e "s:%S::g" -e "s:%t.o::g" %t.json > %t.final.json // RUN: diff -u %S/Inputs/json.c.json %t.final.json // XFAIL: linux
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
<gh_stars>100-1000 //===-- SymbolFileDWARFDwo.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_ #define SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "SymbolFileDWARF.h" class SymbolFileDWARFDwo : public SymbolFileDWARF { public: SymbolFileDWARFDwo(lldb::ObjectFileSP objfile, DWARFCompileUnit *dwarf_cu); ~SymbolFileDWARFDwo() override = default; lldb::CompUnitSP ParseCompileUnit(DWARFCompileUnit *dwarf_cu, uint32_t cu_idx) override; DWARFCompileUnit *GetCompileUnit(); DWARFCompileUnit * GetDWARFCompileUnit(lldb_private::CompileUnit *comp_unit) override; lldb_private::DWARFExpression::LocationListFormat GetLocationListFormat() const override; lldb_private::TypeSystem * GetTypeSystemForLanguage(lldb::LanguageType language) override; DWARFDIE GetDIE(const DIERef &die_ref) override; std::unique_ptr<SymbolFileDWARFDwo> GetDwoSymbolFileForCompileUnit(DWARFCompileUnit &dwarf_cu, const DWARFDebugInfoEntry &cu_die) override { return nullptr; } protected: void LoadSectionData(lldb::SectionType sect_type, lldb_private::DWARFDataExtractor &data) override; DIEToTypePtr &GetDIEToType() override; DIEToVariableSP &GetDIEToVariable() override; DIEToClangType &GetForwardDeclDieToClangType() override; ClangTypeToDIE &GetForwardDeclClangTypeToDie() override; UniqueDWARFASTTypeMap &GetUniqueDWARFASTTypeMap() override; lldb::TypeSP FindDefinitionTypeForDWARFDeclContext( const DWARFDeclContext &die_decl_ctx) override; SymbolFileDWARF *GetBaseSymbolFile(); lldb::ObjectFileSP m_obj_file_sp; DWARFCompileUnit *m_base_dwarf_cu; }; #endif // SymbolFileDWARFDwo_SymbolFileDWARFDwo_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/ValueObjectConstResult.h
<filename>SymbolExtractorAndRenamer/lldb/include/lldb/Core/ValueObjectConstResult.h //===-- ValueObjectConstResult.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ValueObjectConstResult_h_ #define liblldb_ValueObjectConstResult_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Core/ValueObject.h" #include "lldb/Core/ValueObjectConstResultImpl.h" namespace lldb_private { //---------------------------------------------------------------------- // A frozen ValueObject copied into host memory //---------------------------------------------------------------------- class ValueObjectConstResult : public ValueObject { public: ~ValueObjectConstResult() override; static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address = LLDB_INVALID_ADDRESS); static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const CompilerType &compiler_type, const ConstString &name, const DataExtractor &data, lldb::addr_t address = LLDB_INVALID_ADDRESS); static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const CompilerType &compiler_type, const ConstString &name, const lldb::DataBufferSP &result_data_sp, lldb::ByteOrder byte_order, uint32_t addr_size, lldb::addr_t address = LLDB_INVALID_ADDRESS); static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const CompilerType &compiler_type, const ConstString &name, lldb::addr_t address, AddressType address_type, uint32_t addr_byte_size); static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, Value &value, const ConstString &name, Module *module = nullptr); // When an expression fails to evaluate, we return an error static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const Error &error); uint64_t GetByteSize() override; lldb::ValueType GetValueType() const override; size_t CalculateNumChildren(uint32_t max) override; ConstString GetTypeName() override; ConstString GetDisplayTypeName() override; bool IsInScope() override; void SetByteSize(size_t size); lldb::ValueObjectSP Dereference(Error &error) override; ValueObject *CreateChildAtIndex(size_t idx, bool synthetic_array_member, int32_t synthetic_index) override; lldb::ValueObjectSP GetSyntheticChildAtOffset( uint32_t offset, const CompilerType &type, bool can_create, ConstString name_const_str = ConstString()) override; lldb::ValueObjectSP AddressOf(Error &error) override; lldb::addr_t GetAddressOf(bool scalar_is_load_address = true, AddressType *address_type = nullptr) override; size_t GetPointeeData(DataExtractor &data, uint32_t item_idx = 0, uint32_t item_count = 1) override; lldb::addr_t GetLiveAddress() override { return m_impl.GetLiveAddress(); } void SetLiveAddress(lldb::addr_t addr = LLDB_INVALID_ADDRESS, AddressType address_type = eAddressTypeLoad) override { m_impl.SetLiveAddress(addr, address_type); } lldb::ValueObjectSP GetDynamicValue(lldb::DynamicValueType valueType) override; lldb::LanguageType GetPreferredDisplayLanguage() override; lldb::ValueObjectSP Cast(const CompilerType &compiler_type) override; protected: bool UpdateValue() override; CompilerType GetCompilerTypeImpl() override; ConstString m_type_name; uint64_t m_byte_size; ValueObjectConstResultImpl m_impl; private: friend class ValueObjectConstResultImpl; ValueObjectConstResult(ExecutionContextScope *exe_scope, lldb::ByteOrder byte_order, uint32_t addr_byte_size, lldb::addr_t address); ValueObjectConstResult(ExecutionContextScope *exe_scope, const CompilerType &compiler_type, const ConstString &name, const DataExtractor &data, lldb::addr_t address); ValueObjectConstResult(ExecutionContextScope *exe_scope, const CompilerType &compiler_type, const ConstString &name, const lldb::DataBufferSP &result_data_sp, lldb::ByteOrder byte_order, uint32_t addr_size, lldb::addr_t address); ValueObjectConstResult(ExecutionContextScope *exe_scope, const CompilerType &compiler_type, const ConstString &name, lldb::addr_t address, AddressType address_type, uint32_t addr_byte_size); ValueObjectConstResult(ExecutionContextScope *exe_scope, const Value &value, const ConstString &name, Module *module = nullptr); ValueObjectConstResult(ExecutionContextScope *exe_scope, const Error &error); DISALLOW_COPY_AND_ASSIGN(ValueObjectConstResult); }; } // namespace lldb_private #endif // liblldb_ValueObjectConstResult_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/ValueObjectDynamicValue.h
//===-- ValueObjectDynamicValue.h -------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ValueObjectDynamicValue_h_ #define liblldb_ValueObjectDynamicValue_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Core/ValueObject.h" #include "lldb/Symbol/Type.h" namespace lldb_private { //---------------------------------------------------------------------- // A ValueObject that represents memory at a given address, viewed as some // set lldb type. //---------------------------------------------------------------------- class ValueObjectDynamicValue : public ValueObject { public: ~ValueObjectDynamicValue() override; uint64_t GetByteSize() override; ConstString GetTypeName() override; ConstString GetQualifiedTypeName() override; ConstString GetDisplayTypeName() override; size_t CalculateNumChildren(uint32_t max) override; lldb::ValueType GetValueType() const override; bool IsInScope() override; bool IsDynamic() override { return true; } bool IsBaseClass() override { if (m_parent) return m_parent->IsBaseClass(); return false; } bool GetIsConstant() const override { return false; } ValueObject *GetParent() override { return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr); } const ValueObject *GetParent() const override { return ((m_parent != nullptr) ? m_parent->GetParent() : nullptr); } lldb::ValueObjectSP GetStaticValue() override { return m_parent->GetSP(); } void SetOwningSP(lldb::ValueObjectSP &owning_sp) { if (m_owning_valobj_sp == owning_sp) return; assert(m_owning_valobj_sp.get() == nullptr); m_owning_valobj_sp = owning_sp; } bool SetValueFromCString(const char *value_str, Error &error) override; bool SetData(DataExtractor &data, Error &error) override; TypeImpl GetTypeImpl() override; lldb::VariableSP GetVariable() override { return m_parent ? m_parent->GetVariable() : nullptr; } lldb::LanguageType GetPreferredDisplayLanguage() override; void SetPreferredDisplayLanguage(lldb::LanguageType); bool IsSyntheticChildrenGenerated() override; void SetSyntheticChildrenGenerated(bool b) override; bool GetDeclaration(Declaration &decl) override; uint64_t GetLanguageFlags() override; void SetLanguageFlags(uint64_t flags) override; protected: bool UpdateValue() override; LazyBool CanUpdateWithInvalidExecutionContext() override { return eLazyBoolYes; } lldb::DynamicValueType GetDynamicValueTypeImpl() override { return m_use_dynamic; } bool HasDynamicValueTypeInfo() override { return true; } CompilerType GetCompilerTypeImpl() override; Address m_address; ///< The variable that this value object is based upon TypeAndOrName m_dynamic_type_info; // We can have a type_sp or just a name lldb::ValueObjectSP m_owning_valobj_sp; lldb::DynamicValueType m_use_dynamic; TypeImpl m_type_impl; private: friend class ValueObject; friend class ValueObjectConstResult; ValueObjectDynamicValue(ValueObject &parent, lldb::DynamicValueType use_dynamic); DISALLOW_COPY_AND_ASSIGN(ValueObjectDynamicValue); }; } // namespace lldb_private #endif // liblldb_ValueObjectDynamicValue_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/POSIX/ProcessPOSIXLog.h
<gh_stars>100-1000 //===-- ProcessPOSIXLog.h -----------------------------------------*- C++ //-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ProcessPOSIXLog_h_ #define liblldb_ProcessPOSIXLog_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Core/Log.h" #define POSIX_LOG_VERBOSE (1u << 0) #define POSIX_LOG_PROCESS (1u << 1) #define POSIX_LOG_THREAD (1u << 2) #define POSIX_LOG_PACKETS (1u << 3) #define POSIX_LOG_MEMORY (1u << 4) // Log memory reads/writes calls #define POSIX_LOG_MEMORY_DATA_SHORT \ (1u << 5) // Log short memory reads/writes bytes #define POSIX_LOG_MEMORY_DATA_LONG \ (1u << 6) // Log all memory reads/writes bytes #define POSIX_LOG_BREAKPOINTS (1u << 7) #define POSIX_LOG_WATCHPOINTS (1u << 8) #define POSIX_LOG_STEP (1u << 9) #define POSIX_LOG_COMM (1u << 10) #define POSIX_LOG_ASYNC (1u << 11) #define POSIX_LOG_PTRACE (1u << 12) #define POSIX_LOG_REGISTERS (1u << 13) #define POSIX_LOG_ALL (UINT32_MAX) #define POSIX_LOG_DEFAULT POSIX_LOG_PACKETS // The size which determines "short memory reads/writes". #define POSIX_LOG_MEMORY_SHORT_BYTES (4 * sizeof(ptrdiff_t)) class ProcessPOSIXLog { static int m_nestinglevel; static const char *m_pluginname; public: // --------------------------------------------------------------------- // Public Static Methods // --------------------------------------------------------------------- static void Initialize(lldb_private::ConstString name); static void RegisterPluginName(const char *pluginName) { m_pluginname = pluginName; } static void RegisterPluginName(lldb_private::ConstString pluginName) { m_pluginname = pluginName.GetCString(); } static lldb_private::Log *GetLogIfAllCategoriesSet(uint32_t mask = 0); static void DisableLog(const char **args, lldb_private::Stream *feedback_strm); static lldb_private::Log *EnableLog(lldb::StreamSP &log_stream_sp, uint32_t log_options, const char **args, lldb_private::Stream *feedback_strm); static void ListLogCategories(lldb_private::Stream *strm); static void LogIf(uint32_t mask, const char *format, ...); // The following functions can be used to enable the client to limit // logging to only the top level function calls. This is useful for // recursive functions. FIXME: not thread safe! // Example: // void NestingFunc() { // LogSP log // (ProcessPOSIXLog::GetLogIfAllCategoriesSet(POSIX_LOG_ALL)); // if (log) // { // ProcessPOSIXLog::IncNestLevel(); // if (ProcessPOSIXLog::AtTopNestLevel()) // log->Print(msg); // } // NestingFunc(); // if (log) // ProcessPOSIXLog::DecNestLevel(); // } static bool AtTopNestLevel() { return m_nestinglevel == 1; } static void IncNestLevel() { ++m_nestinglevel; } static void DecNestLevel() { --m_nestinglevel; assert(m_nestinglevel >= 0); } }; #endif // liblldb_ProcessPOSIXLog_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/linux/AbstractSocket.h
//===-- AbstractSocket.h ----------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_AbstractSocket_h_ #define liblldb_AbstractSocket_h_ #include "lldb/Host/posix/DomainSocket.h" namespace lldb_private { class AbstractSocket : public DomainSocket { public: AbstractSocket(bool child_processes_inherit, Error &error); protected: size_t GetNameOffset() const override; void DeleteSocketFile(llvm::StringRef name) override; }; } #endif // ifndef liblldb_AbstractSocket_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/cmark/src/scanners.c
<gh_stars>100-1000 /* Generated by re2c 0.14.3 */ #include <stdlib.h> #include "chunk.h" #include "scanners.h" bufsize_t _scan_at(bufsize_t (*scanner)(const unsigned char *), cmark_chunk *c, bufsize_t offset) { bufsize_t res; unsigned char *ptr = (unsigned char *)c->data; unsigned char zero = '\0'; if (ptr == NULL) { res = scanner(&zero); } else { unsigned char lim = ptr[c->len]; ptr[c->len] = '\0'; res = scanner(ptr + offset); ptr[c->len] = lim; } return res; } // Try to match a scheme including colon. bufsize_t _scan_scheme(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; yych = *(marker = p); if (yych <= 'c') { if (yych <= 'M') { if (yych <= 'E') { if (yych <= 'A') { if (yych == '\n') goto yy2; if (yych <= '@') goto yy29; goto yy6; } else { if (yych <= 'B') goto yy24; if (yych <= 'C') goto yy3; if (yych <= 'D') goto yy4; goto yy25; } } else { if (yych <= 'I') { if (yych <= 'F') goto yy7; if (yych <= 'G') goto yy8; if (yych <= 'H') goto yy9; goto yy10; } else { if (yych <= 'J') goto yy5; if (yych <= 'K') goto yy26; if (yych <= 'L') goto yy11; goto yy12; } } } else { if (yych <= 'U') { if (yych <= 'Q') { if (yych <= 'N') goto yy13; if (yych <= 'O') goto yy14; if (yych <= 'P') goto yy15; goto yy27; } else { if (yych <= 'R') goto yy16; if (yych <= 'S') goto yy17; if (yych <= 'T') goto yy18; goto yy19; } } else { if (yych <= 'Y') { if (yych <= 'V') goto yy20; if (yych <= 'W') goto yy21; if (yych <= 'X') goto yy22; goto yy28; } else { if (yych <= '`') { if (yych <= 'Z') goto yy23; goto yy29; } else { if (yych <= 'a') goto yy6; if (yych <= 'b') goto yy24; goto yy3; } } } } } else { if (yych <= 't') { if (yych <= 'k') { if (yych <= 'g') { if (yych <= 'd') goto yy4; if (yych <= 'e') goto yy25; if (yych <= 'f') goto yy7; goto yy8; } else { if (yych <= 'h') goto yy9; if (yych <= 'i') goto yy10; if (yych <= 'j') goto yy5; goto yy26; } } else { if (yych <= 'o') { if (yych <= 'l') goto yy11; if (yych <= 'm') goto yy12; if (yych <= 'n') goto yy13; goto yy14; } else { if (yych <= 'q') { if (yych <= 'p') goto yy15; goto yy27; } else { if (yych <= 'r') goto yy16; if (yych <= 's') goto yy17; goto yy18; } } } } else { if (yych <= 0xC1) { if (yych <= 'x') { if (yych <= 'u') goto yy19; if (yych <= 'v') goto yy20; if (yych <= 'w') goto yy21; goto yy22; } else { if (yych <= 'y') goto yy28; if (yych <= 'z') goto yy23; if (yych <= 0x7F) goto yy29; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy30; if (yych <= 0xE0) goto yy32; if (yych <= 0xEC) goto yy33; goto yy37; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy33; goto yy34; } else { if (yych <= 0xF3) goto yy35; if (yych <= 0xF4) goto yy36; } } } } } yy2 : { return 0; } yy3: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy447; case 'H': case 'h': goto yy446; case 'I': case 'i': goto yy449; case 'O': case 'o': goto yy445; case 'R': case 'r': goto yy448; case 'V': case 'v': goto yy444; default: goto yy2; } yy4: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy420; case 'I': case 'i': goto yy419; case 'L': case 'l': goto yy417; case 'N': case 'n': goto yy418; case 'O': case 'o': goto yy421; case 'T': case 't': goto yy416; case 'V': case 'v': goto yy415; default: goto yy2; } yy5: yych = *(marker = ++p); if (yych <= 'M') { if (yych == 'A') goto yy407; if (yych <= 'L') goto yy2; goto yy406; } else { if (yych <= 'a') { if (yych <= '`') goto yy2; goto yy407; } else { if (yych == 'm') goto yy406; goto yy2; } } yy6: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy388; case 'B': case 'b': goto yy387; case 'C': case 'c': goto yy386; case 'D': case 'd': goto yy385; case 'F': case 'f': goto yy384; case 'I': case 'i': goto yy383; case 'P': case 'p': goto yy382; case 'T': case 't': goto yy381; case 'W': case 'w': goto yy41; default: goto yy2; } yy7: yych = *(marker = ++p); if (yych <= 'T') { if (yych <= 'E') { if (yych == 'A') goto yy368; if (yych <= 'D') goto yy2; goto yy367; } else { if (yych == 'I') goto yy366; if (yych <= 'S') goto yy2; goto yy369; } } else { if (yych <= 'e') { if (yych == 'a') goto yy368; if (yych <= 'd') goto yy2; goto yy367; } else { if (yych <= 'i') { if (yych <= 'h') goto yy2; goto yy366; } else { if (yych == 't') goto yy369; goto yy2; } } } yy8: yych = *(marker = ++p); switch (yych) { case 'E': case 'e': goto yy351; case 'G': case 'g': goto yy41; case 'I': case 'i': goto yy349; case 'O': case 'o': goto yy350; case 'T': case 't': goto yy348; default: goto yy2; } yy9: yych = *(marker = ++p); if (yych <= 'S') { if (yych <= '3') { if (yych <= '2') goto yy2; goto yy344; } else { if (yych == 'C') goto yy342; goto yy2; } } else { if (yych <= 'c') { if (yych <= 'T') goto yy343; if (yych <= 'b') goto yy2; goto yy342; } else { if (yych == 't') goto yy343; goto yy2; } } yy10: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy324; case 'C': case 'c': goto yy321; case 'M': case 'm': goto yy323; case 'N': case 'n': goto yy322; case 'P': case 'p': goto yy320; case 'R': case 'r': goto yy319; case 'T': case 't': goto yy318; default: goto yy2; } yy11: yych = *(marker = ++p); if (yych <= 'D') { if (yych == 'A') goto yy312; if (yych <= 'C') goto yy2; goto yy311; } else { if (yych <= 'a') { if (yych <= '`') goto yy2; goto yy312; } else { if (yych == 'd') goto yy311; goto yy2; } } yy12: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy278; case 'E': case 'e': goto yy277; case 'I': case 'i': goto yy280; case 'M': case 'm': goto yy276; case 'S': case 's': goto yy275; case 'T': case 't': goto yy279; case 'U': case 'u': goto yy274; case 'V': case 'v': goto yy273; default: goto yy2; } yy13: yych = *(marker = ++p); switch (yych) { case 'E': case 'e': goto yy268; case 'F': case 'f': goto yy267; case 'I': case 'i': goto yy266; case 'N': case 'n': goto yy265; case 'O': case 'o': goto yy264; default: goto yy2; } yy14: yych = *(marker = ++p); if (yych <= 'P') { if (yych == 'I') goto yy250; if (yych <= 'O') goto yy2; goto yy251; } else { if (yych <= 'i') { if (yych <= 'h') goto yy2; goto yy250; } else { if (yych == 'p') goto yy251; goto yy2; } } yy15: yych = *(marker = ++p); if (yych <= 'S') { if (yych <= 'L') { if (yych == 'A') goto yy232; if (yych <= 'K') goto yy2; goto yy231; } else { if (yych <= 'O') { if (yych <= 'N') goto yy2; goto yy233; } else { if (yych <= 'Q') goto yy2; if (yych <= 'R') goto yy230; goto yy229; } } } else { if (yych <= 'n') { if (yych <= 'a') { if (yych <= '`') goto yy2; goto yy232; } else { if (yych == 'l') goto yy231; goto yy2; } } else { if (yych <= 'q') { if (yych <= 'o') goto yy233; goto yy2; } else { if (yych <= 'r') goto yy230; if (yych <= 's') goto yy229; goto yy2; } } } yy16: yych = *(marker = ++p); if (yych <= 'T') { if (yych <= 'L') { if (yych == 'E') goto yy219; goto yy2; } else { if (yych <= 'M') goto yy218; if (yych <= 'R') goto yy2; if (yych <= 'S') goto yy217; goto yy216; } } else { if (yych <= 'm') { if (yych == 'e') goto yy219; if (yych <= 'l') goto yy2; goto yy218; } else { if (yych <= 'r') goto yy2; if (yych <= 's') goto yy217; if (yych <= 't') goto yy216; goto yy2; } } yy17: yych = *(marker = ++p); switch (yych) { case 'E': case 'e': goto yy172; case 'F': case 'f': goto yy171; case 'G': case 'g': goto yy170; case 'H': case 'h': goto yy175; case 'I': case 'i': goto yy174; case 'K': case 'k': goto yy169; case 'M': case 'm': goto yy168; case 'N': case 'n': goto yy173; case 'O': case 'o': goto yy167; case 'P': case 'p': goto yy166; case 'S': case 's': goto yy165; case 'T': case 't': goto yy164; case 'V': case 'v': goto yy163; default: goto yy2; } yy18: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy139; case 'E': case 'e': goto yy135; case 'F': case 'f': goto yy138; case 'H': case 'h': goto yy134; case 'I': case 'i': goto yy136; case 'N': case 'n': goto yy137; case 'V': case 'v': goto yy41; default: goto yy2; } yy19: yych = *(marker = ++p); if (yych <= 'T') { if (yych <= 'N') { if (yych == 'D') goto yy126; if (yych <= 'M') goto yy2; goto yy125; } else { if (yych == 'R') goto yy127; if (yych <= 'S') goto yy2; goto yy124; } } else { if (yych <= 'n') { if (yych == 'd') goto yy126; if (yych <= 'm') goto yy2; goto yy125; } else { if (yych <= 'r') { if (yych <= 'q') goto yy2; goto yy127; } else { if (yych == 't') goto yy124; goto yy2; } } } yy20: yych = *(marker = ++p); if (yych <= 'I') { if (yych == 'E') goto yy108; if (yych <= 'H') goto yy2; goto yy107; } else { if (yych <= 'e') { if (yych <= 'd') goto yy2; goto yy108; } else { if (yych == 'i') goto yy107; goto yy2; } } yy21: yych = *(marker = ++p); if (yych <= 'Y') { if (yych <= 'R') { if (yych == 'E') goto yy97; goto yy2; } else { if (yych <= 'S') goto yy98; if (yych <= 'T') goto yy96; if (yych <= 'X') goto yy2; goto yy95; } } else { if (yych <= 's') { if (yych == 'e') goto yy97; if (yych <= 'r') goto yy2; goto yy98; } else { if (yych <= 't') goto yy96; if (yych == 'y') goto yy95; goto yy2; } } yy22: yych = *(marker = ++p); if (yych <= 'R') { if (yych <= 'F') { if (yych == 'C') goto yy74; if (yych <= 'E') goto yy2; goto yy72; } else { if (yych == 'M') goto yy73; if (yych <= 'Q') goto yy2; goto yy71; } } else { if (yych <= 'f') { if (yych == 'c') goto yy74; if (yych <= 'e') goto yy2; goto yy72; } else { if (yych <= 'm') { if (yych <= 'l') goto yy2; goto yy73; } else { if (yych == 'r') goto yy71; goto yy2; } } } yy23: yych = *(marker = ++p); if (yych == '3') goto yy66; goto yy2; yy24: yych = *(marker = ++p); if (yych <= 'O') { if (yych <= 'H') { if (yych == 'E') goto yy56; goto yy2; } else { if (yych <= 'I') goto yy55; if (yych <= 'N') goto yy2; goto yy54; } } else { if (yych <= 'h') { if (yych == 'e') goto yy56; goto yy2; } else { if (yych <= 'i') goto yy55; if (yych == 'o') goto yy54; goto yy2; } } yy25: yych = *(marker = ++p); if (yych == 'D') goto yy52; if (yych == 'd') goto yy52; goto yy2; yy26: yych = *(marker = ++p); if (yych == 'E') goto yy47; if (yych == 'e') goto yy47; goto yy2; yy27: yych = *(marker = ++p); if (yych == 'U') goto yy44; if (yych == 'u') goto yy44; goto yy2; yy28: yych = *(marker = ++p); if (yych == 'M') goto yy38; if (yych == 'm') goto yy38; goto yy2; yy29: yych = *++p; goto yy2; yy30: yych = *++p; if (yych <= 0x7F) goto yy31; if (yych <= 0xBF) goto yy29; yy31: p = marker; goto yy2; yy32: yych = *++p; if (yych <= 0x9F) goto yy31; if (yych <= 0xBF) goto yy30; goto yy31; yy33: yych = *++p; if (yych <= 0x7F) goto yy31; if (yych <= 0xBF) goto yy30; goto yy31; yy34: yych = *++p; if (yych <= 0x8F) goto yy31; if (yych <= 0xBF) goto yy33; goto yy31; yy35: yych = *++p; if (yych <= 0x7F) goto yy31; if (yych <= 0xBF) goto yy33; goto yy31; yy36: yych = *++p; if (yych <= 0x7F) goto yy31; if (yych <= 0x8F) goto yy33; goto yy31; yy37: yych = *++p; if (yych <= 0x7F) goto yy31; if (yych <= 0x9F) goto yy30; goto yy31; yy38: yych = *++p; if (yych == 'S') goto yy39; if (yych != 's') goto yy31; yy39: yych = *++p; if (yych == 'G') goto yy40; if (yych != 'g') goto yy31; yy40: yych = *++p; if (yych == 'R') goto yy41; if (yych != 'r') goto yy31; yy41: yych = *++p; if (yych != ':') goto yy31; yy42: ++p; { return (bufsize_t)(p - start); } yy44: yych = *++p; if (yych == 'E') goto yy45; if (yych != 'e') goto yy31; yy45: yych = *++p; if (yych == 'R') goto yy46; if (yych != 'r') goto yy31; yy46: yych = *++p; if (yych == 'Y') goto yy41; if (yych == 'y') goto yy41; goto yy31; yy47: yych = *++p; if (yych == 'Y') goto yy48; if (yych != 'y') goto yy31; yy48: yych = *++p; if (yych == 'P') goto yy49; if (yych != 'p') goto yy31; yy49: yych = *++p; if (yych == 'A') goto yy50; if (yych != 'a') goto yy31; yy50: yych = *++p; if (yych == 'R') goto yy51; if (yych != 'r') goto yy31; yy51: yych = *++p; if (yych == 'C') goto yy41; if (yych == 'c') goto yy41; goto yy31; yy52: yych = *++p; if (yych != '2') goto yy31; yych = *++p; if (yych == 'K') goto yy41; if (yych == 'k') goto yy41; goto yy31; yy54: yych = *++p; if (yych == 'L') goto yy65; if (yych == 'l') goto yy65; goto yy31; yy55: yych = *++p; if (yych == 'T') goto yy61; if (yych == 't') goto yy61; goto yy31; yy56: yych = *++p; if (yych == 'S') goto yy57; if (yych != 's') goto yy31; yy57: yych = *++p; if (yych == 'H') goto yy58; if (yych != 'h') goto yy31; yy58: yych = *++p; if (yych == 'A') goto yy59; if (yych != 'a') goto yy31; yy59: yych = *++p; if (yych == 'R') goto yy60; if (yych != 'r') goto yy31; yy60: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy61: yych = *++p; if (yych == 'C') goto yy62; if (yych != 'c') goto yy31; yy62: yych = *++p; if (yych == 'O') goto yy63; if (yych != 'o') goto yy31; yy63: yych = *++p; if (yych == 'I') goto yy64; if (yych != 'i') goto yy31; yy64: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy65: yych = *++p; if (yych == 'O') goto yy41; if (yych == 'o') goto yy41; goto yy31; yy66: yych = *++p; if (yych != '9') goto yy31; yych = *++p; if (yych != '.') goto yy31; yych = *++p; if (yych != '5') goto yy31; yych = *++p; if (yych != '0') goto yy31; yych = *++p; if (yych <= 'Q') goto yy31; if (yych <= 'S') goto yy41; if (yych <= 'q') goto yy31; if (yych <= 's') goto yy41; goto yy31; yy71: yych = *++p; if (yych == 'I') goto yy41; if (yych == 'i') goto yy41; goto yy31; yy72: yych = *++p; if (yych == 'I') goto yy93; if (yych == 'i') goto yy93; goto yy31; yy73: yych = *++p; if (yych <= 'P') { if (yych == 'L') goto yy83; if (yych <= 'O') goto yy31; goto yy84; } else { if (yych <= 'l') { if (yych <= 'k') goto yy31; goto yy83; } else { if (yych == 'p') goto yy84; goto yy31; } } yy74: yych = *++p; if (yych == 'O') goto yy75; if (yych != 'o') goto yy31; yy75: yych = *++p; if (yych == 'N') goto yy76; if (yych != 'n') goto yy31; yy76: yych = *++p; if (yych == '-') goto yy77; if (yych == ':') goto yy42; goto yy31; yy77: yych = *++p; if (yych == 'U') goto yy78; if (yych != 'u') goto yy31; yy78: yych = *++p; if (yych == 'S') goto yy79; if (yych != 's') goto yy31; yy79: yych = *++p; if (yych == 'E') goto yy80; if (yych != 'e') goto yy31; yy80: yych = *++p; if (yych == 'R') goto yy81; if (yych != 'r') goto yy31; yy81: yych = *++p; if (yych == 'I') goto yy82; if (yych != 'i') goto yy31; yy82: yych = *++p; if (yych == 'D') goto yy41; if (yych == 'd') goto yy41; goto yy31; yy83: yych = *++p; if (yych == 'R') goto yy85; if (yych == 'r') goto yy85; goto yy31; yy84: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy85: yych = *++p; if (yych == 'P') goto yy86; if (yych != 'p') goto yy31; yy86: yych = *++p; if (yych == 'C') goto yy87; if (yych != 'c') goto yy31; yy87: yych = *++p; if (yych != '.') goto yy31; yych = *++p; if (yych == 'B') goto yy89; if (yych != 'b') goto yy31; yy89: yych = *++p; if (yych == 'E') goto yy90; if (yych != 'e') goto yy31; yy90: yych = *++p; if (yych == 'E') goto yy91; if (yych != 'e') goto yy31; yy91: yych = *++p; if (yych == 'P') goto yy92; if (yych != 'p') goto yy31; yy92: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy93: yych = *++p; if (yych == 'R') goto yy94; if (yych != 'r') goto yy31; yy94: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy95: yych = *++p; if (yych == 'C') goto yy103; if (yych == 'c') goto yy103; goto yy31; yy96: yych = *++p; if (yych == 'A') goto yy102; if (yych == 'a') goto yy102; goto yy31; yy97: yych = *++p; if (yych == 'B') goto yy99; if (yych == 'b') goto yy99; goto yy31; yy98: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy99: yych = *++p; if (yych == 'C') goto yy100; if (yych != 'c') goto yy31; yy100: yych = *++p; if (yych == 'A') goto yy101; if (yych != 'a') goto yy31; yy101: yych = *++p; if (yych == 'L') goto yy41; if (yych == 'l') goto yy41; goto yy31; yy102: yych = *++p; if (yych == 'I') goto yy41; if (yych == 'i') goto yy41; goto yy31; yy103: yych = *++p; if (yych == 'I') goto yy104; if (yych != 'i') goto yy31; yy104: yych = *++p; if (yych == 'W') goto yy105; if (yych != 'w') goto yy31; yy105: yych = *++p; if (yych == 'Y') goto yy106; if (yych != 'y') goto yy31; yy106: yych = *++p; if (yych == 'G') goto yy41; if (yych == 'g') goto yy41; goto yy31; yy107: yych = *++p; if (yych == 'E') goto yy116; if (yych == 'e') goto yy116; goto yy31; yy108: yych = *++p; if (yych <= 'N') { if (yych <= 'L') goto yy31; if (yych >= 'N') goto yy110; } else { if (yych <= 'l') goto yy31; if (yych <= 'm') goto yy109; if (yych <= 'n') goto yy110; goto yy31; } yy109: yych = *++p; if (yych == 'M') goto yy115; if (yych == 'm') goto yy115; goto yy31; yy110: yych = *++p; if (yych == 'T') goto yy111; if (yych != 't') goto yy31; yy111: yych = *++p; if (yych == 'R') goto yy112; if (yych != 'r') goto yy31; yy112: yych = *++p; if (yych == 'I') goto yy113; if (yych != 'i') goto yy31; yy113: yych = *++p; if (yych == 'L') goto yy114; if (yych != 'l') goto yy31; yy114: yych = *++p; if (yych == 'O') goto yy41; if (yych == 'o') goto yy41; goto yy31; yy115: yych = *++p; if (yych == 'I') goto yy41; if (yych == 'i') goto yy41; goto yy31; yy116: yych = *++p; if (yych == 'W') goto yy117; if (yych != 'w') goto yy31; yy117: yych = *++p; if (yych != '-') goto yy31; yych = *++p; if (yych == 'S') goto yy119; if (yych != 's') goto yy31; yy119: yych = *++p; if (yych == 'O') goto yy120; if (yych != 'o') goto yy31; yy120: yych = *++p; if (yych == 'U') goto yy121; if (yych != 'u') goto yy31; yy121: yych = *++p; if (yych == 'R') goto yy122; if (yych != 'r') goto yy31; yy122: yych = *++p; if (yych == 'C') goto yy123; if (yych != 'c') goto yy31; yy123: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy124: yych = *++p; if (yych == '2') goto yy131; goto yy31; yy125: yych = *++p; if (yych == 'R') goto yy128; if (yych == 'r') goto yy128; goto yy31; yy126: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy127: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy128: yych = *++p; if (yych == 'E') goto yy129; if (yych != 'e') goto yy31; yy129: yych = *++p; if (yych == 'A') goto yy130; if (yych != 'a') goto yy31; yy130: yych = *++p; if (yych == 'L') goto yy41; if (yych == 'l') goto yy41; goto yy31; yy131: yych = *++p; if (yych != '0') goto yy31; yych = *++p; if (yych != '0') goto yy31; yych = *++p; if (yych == '4') goto yy41; goto yy31; yy134: yych = *++p; if (yych == 'I') goto yy153; if (yych == 'i') goto yy153; goto yy31; yy135: yych = *++p; if (yych <= 'L') { if (yych == 'A') goto yy145; if (yych <= 'K') goto yy31; goto yy144; } else { if (yych <= 'a') { if (yych <= '`') goto yy31; goto yy145; } else { if (yych == 'l') goto yy144; goto yy31; } } yy136: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy137: yych = *++p; if (yych == '3') goto yy141; goto yy31; yy138: yych = *++p; if (yych == 'T') goto yy140; if (yych == 't') goto yy140; goto yy31; yy139: yych = *++p; if (yych == 'G') goto yy41; if (yych == 'g') goto yy41; goto yy31; yy140: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy141: yych = *++p; if (yych != '2') goto yy31; yych = *++p; if (yych != '7') goto yy31; yych = *++p; if (yych == '0') goto yy41; goto yy31; yy144: yych = *++p; if (yych <= 'M') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'N') goto yy151; if (yych == 'n') goto yy151; goto yy31; } yy145: yych = *++p; if (yych == 'M') goto yy146; if (yych != 'm') goto yy31; yy146: yych = *++p; if (yych == 'S') goto yy147; if (yych != 's') goto yy31; yy147: yych = *++p; if (yych == 'P') goto yy148; if (yych != 'p') goto yy31; yy148: yych = *++p; if (yych == 'E') goto yy149; if (yych != 'e') goto yy31; yy149: yych = *++p; if (yych == 'A') goto yy150; if (yych != 'a') goto yy31; yy150: yych = *++p; if (yych == 'K') goto yy41; if (yych == 'k') goto yy41; goto yy31; yy151: yych = *++p; if (yych == 'E') goto yy152; if (yych != 'e') goto yy31; yy152: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy153: yych = *++p; if (yych <= 'S') { if (yych == 'N') goto yy154; if (yych <= 'R') goto yy31; goto yy155; } else { if (yych <= 'n') { if (yych <= 'm') goto yy31; } else { if (yych == 's') goto yy155; goto yy31; } } yy154: yych = *++p; if (yych == 'G') goto yy162; if (yych == 'g') goto yy162; goto yy31; yy155: yych = *++p; if (yych == 'M') goto yy156; if (yych != 'm') goto yy31; yy156: yych = *++p; if (yych == 'E') goto yy157; if (yych != 'e') goto yy31; yy157: yych = *++p; if (yych == 'S') goto yy158; if (yych != 's') goto yy31; yy158: yych = *++p; if (yych == 'S') goto yy159; if (yych != 's') goto yy31; yy159: yych = *++p; if (yych == 'A') goto yy160; if (yych != 'a') goto yy31; yy160: yych = *++p; if (yych == 'G') goto yy161; if (yych != 'g') goto yy31; yy161: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy162: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy163: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy164: yych = *++p; if (yych == 'E') goto yy214; if (yych == 'e') goto yy214; goto yy31; yy165: yych = *++p; if (yych == 'H') goto yy41; if (yych == 'h') goto yy41; goto yy31; yy166: yych = *++p; if (yych == 'O') goto yy210; if (yych == 'o') goto yy210; goto yy31; yy167: yych = *++p; if (yych <= 'L') { if (yych == 'A') goto yy200; if (yych <= 'K') goto yy31; goto yy201; } else { if (yych <= 'a') { if (yych <= '`') goto yy31; goto yy200; } else { if (yych == 'l') goto yy201; goto yy31; } } yy168: yych = *++p; if (yych <= 'S') { if (yych == 'B') goto yy41; if (yych <= 'R') goto yy31; goto yy41; } else { if (yych <= 'b') { if (yych <= 'a') goto yy31; goto yy41; } else { if (yych == 's') goto yy41; goto yy31; } } yy169: yych = *++p; if (yych == 'Y') goto yy198; if (yych == 'y') goto yy198; goto yy31; yy170: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy171: yych = *++p; if (yych == 'T') goto yy197; if (yych == 't') goto yy197; goto yy31; yy172: yych = *++p; if (yych <= 'S') { if (yych <= 'C') { if (yych <= 'B') goto yy31; goto yy184; } else { if (yych <= 'Q') goto yy31; if (yych <= 'R') goto yy182; goto yy183; } } else { if (yych <= 'q') { if (yych == 'c') goto yy184; goto yy31; } else { if (yych <= 'r') goto yy182; if (yych <= 's') goto yy183; goto yy31; } } yy173: yych = *++p; if (yych == 'M') goto yy181; if (yych == 'm') goto yy181; goto yy31; yy174: yych = *++p; if (yych <= 'P') { if (yych == 'E') goto yy178; if (yych <= 'O') goto yy31; goto yy179; } else { if (yych <= 'e') { if (yych <= 'd') goto yy31; goto yy178; } else { if (yych == 'p') goto yy179; goto yy31; } } yy175: yych = *++p; if (yych == 'T') goto yy176; if (yych != 't') goto yy31; yy176: yych = *++p; if (yych == 'T') goto yy177; if (yych != 't') goto yy31; yy177: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy178: yych = *++p; if (yych == 'V') goto yy180; if (yych == 'v') goto yy180; goto yy31; yy179: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy180: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy181: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy182: yych = *++p; if (yych == 'V') goto yy194; if (yych == 'v') goto yy194; goto yy31; yy183: yych = *++p; if (yych == 'S') goto yy191; if (yych == 's') goto yy191; goto yy31; yy184: yych = *++p; if (yych == 'O') goto yy185; if (yych != 'o') goto yy31; yy185: yych = *++p; if (yych == 'N') goto yy186; if (yych != 'n') goto yy31; yy186: yych = *++p; if (yych == 'D') goto yy187; if (yych != 'd') goto yy31; yy187: yych = *++p; if (yych == 'L') goto yy188; if (yych != 'l') goto yy31; yy188: yych = *++p; if (yych == 'I') goto yy189; if (yych != 'i') goto yy31; yy189: yych = *++p; if (yych == 'F') goto yy190; if (yych != 'f') goto yy31; yy190: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy191: yych = *++p; if (yych == 'I') goto yy192; if (yych != 'i') goto yy31; yy192: yych = *++p; if (yych == 'O') goto yy193; if (yych != 'o') goto yy31; yy193: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy194: yych = *++p; if (yych == 'I') goto yy195; if (yych != 'i') goto yy31; yy195: yych = *++p; if (yych == 'C') goto yy196; if (yych != 'c') goto yy31; yy196: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy197: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy198: yych = *++p; if (yych == 'P') goto yy199; if (yych != 'p') goto yy31; yy199: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy200: yych = *++p; if (yych == 'P') goto yy204; if (yych == 'p') goto yy204; goto yy31; yy201: yych = *++p; if (yych == 'D') goto yy202; if (yych != 'd') goto yy31; yy202: yych = *++p; if (yych == 'A') goto yy203; if (yych != 'a') goto yy31; yy203: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy204: yych = *++p; if (yych != '.') goto yy31; yych = *++p; if (yych == 'B') goto yy206; if (yych != 'b') goto yy31; yy206: yych = *++p; if (yych == 'E') goto yy207; if (yych != 'e') goto yy31; yy207: yych = *++p; if (yych == 'E') goto yy208; if (yych != 'e') goto yy31; yy208: yych = *++p; if (yych == 'P') goto yy209; if (yych != 'p') goto yy31; yy209: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy210: yych = *++p; if (yych == 'T') goto yy211; if (yych != 't') goto yy31; yy211: yych = *++p; if (yych == 'I') goto yy212; if (yych != 'i') goto yy31; yy212: yych = *++p; if (yych == 'F') goto yy213; if (yych != 'f') goto yy31; yy213: yych = *++p; if (yych == 'Y') goto yy41; if (yych == 'y') goto yy41; goto yy31; yy214: yych = *++p; if (yych == 'A') goto yy215; if (yych != 'a') goto yy31; yy215: yych = *++p; if (yych == 'M') goto yy41; if (yych == 'm') goto yy41; goto yy31; yy216: yych = *++p; if (yych <= 'S') { if (yych == 'M') goto yy228; if (yych <= 'R') goto yy31; goto yy227; } else { if (yych <= 'm') { if (yych <= 'l') goto yy31; goto yy228; } else { if (yych == 's') goto yy227; goto yy31; } } yy217: yych = *++p; if (yych == 'Y') goto yy225; if (yych == 'y') goto yy225; goto yy31; yy218: yych = *++p; if (yych == 'I') goto yy41; if (yych == 'i') goto yy41; goto yy31; yy219: yych = *++p; if (yych == 'S') goto yy220; if (yych != 's') goto yy31; yy220: yych = *++p; if (yych <= 'N') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'O') goto yy221; if (yych != 'o') goto yy31; } yy221: yych = *++p; if (yych == 'U') goto yy222; if (yych != 'u') goto yy31; yy222: yych = *++p; if (yych == 'R') goto yy223; if (yych != 'r') goto yy31; yy223: yych = *++p; if (yych == 'C') goto yy224; if (yych != 'c') goto yy31; yy224: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy225: yych = *++p; if (yych == 'N') goto yy226; if (yych != 'n') goto yy31; yy226: yych = *++p; if (yych == 'C') goto yy41; if (yych == 'c') goto yy41; goto yy31; yy227: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy228: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy229: yych = *++p; if (yych == 'Y') goto yy249; if (yych == 'y') goto yy249; goto yy31; yy230: yych = *++p; if (yych <= 'O') { if (yych == 'E') goto yy246; if (yych <= 'N') goto yy31; goto yy247; } else { if (yych <= 'e') { if (yych <= 'd') goto yy31; goto yy246; } else { if (yych == 'o') goto yy247; goto yy31; } } yy231: yych = *++p; if (yych == 'A') goto yy241; if (yych == 'a') goto yy241; goto yy31; yy232: yych = *++p; if (yych <= 'P') { if (yych == 'L') goto yy234; if (yych <= 'O') goto yy31; goto yy235; } else { if (yych <= 'l') { if (yych <= 'k') goto yy31; goto yy234; } else { if (yych == 'p') goto yy235; goto yy31; } } yy233: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy234: yych = *++p; if (yych == 'M') goto yy41; if (yych == 'm') goto yy41; goto yy31; yy235: yych = *++p; if (yych == 'A') goto yy236; if (yych != 'a') goto yy31; yy236: yych = *++p; if (yych == 'R') goto yy237; if (yych != 'r') goto yy31; yy237: yych = *++p; if (yych == 'A') goto yy238; if (yych != 'a') goto yy31; yy238: yych = *++p; if (yych == 'Z') goto yy239; if (yych != 'z') goto yy31; yy239: yych = *++p; if (yych == 'Z') goto yy240; if (yych != 'z') goto yy31; yy240: yych = *++p; if (yych == 'I') goto yy41; if (yych == 'i') goto yy41; goto yy31; yy241: yych = *++p; if (yych == 'T') goto yy242; if (yych != 't') goto yy31; yy242: yych = *++p; if (yych == 'F') goto yy243; if (yych != 'f') goto yy31; yy243: yych = *++p; if (yych == 'O') goto yy244; if (yych != 'o') goto yy31; yy244: yych = *++p; if (yych == 'R') goto yy245; if (yych != 'r') goto yy31; yy245: yych = *++p; if (yych == 'M') goto yy41; if (yych == 'm') goto yy41; goto yy31; yy246: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy247: yych = *++p; if (yych == 'X') goto yy248; if (yych != 'x') goto yy31; yy248: yych = *++p; if (yych == 'Y') goto yy41; if (yych == 'y') goto yy41; goto yy31; yy249: yych = *++p; if (yych == 'C') goto yy41; if (yych == 'c') goto yy41; goto yy31; yy250: yych = *++p; if (yych == 'D') goto yy41; if (yych == 'd') goto yy41; goto yy31; yy251: yych = *++p; if (yych == 'A') goto yy252; if (yych != 'a') goto yy31; yy252: yych = *++p; if (yych == 'Q') goto yy253; if (yych != 'q') goto yy31; yy253: yych = *++p; if (yych == 'U') goto yy254; if (yych != 'u') goto yy31; yy254: yych = *++p; if (yych == 'E') goto yy255; if (yych != 'e') goto yy31; yy255: yych = *++p; if (yych == 'L') goto yy256; if (yych != 'l') goto yy31; yy256: yych = *++p; if (yych == 'O') goto yy257; if (yych != 'o') goto yy31; yy257: yych = *++p; if (yych == 'C') goto yy258; if (yych != 'c') goto yy31; yy258: yych = *++p; if (yych == 'K') goto yy259; if (yych != 'k') goto yy31; yy259: yych = *++p; if (yych == 'T') goto yy260; if (yych != 't') goto yy31; yy260: yych = *++p; if (yych == 'O') goto yy261; if (yych != 'o') goto yy31; yy261: yych = *++p; if (yych == 'K') goto yy262; if (yych != 'k') goto yy31; yy262: yych = *++p; if (yych == 'E') goto yy263; if (yych != 'e') goto yy31; yy263: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy264: yych = *++p; if (yych == 'T') goto yy271; if (yych == 't') goto yy271; goto yy31; yy265: yych = *++p; if (yych == 'T') goto yy270; if (yych == 't') goto yy270; goto yy31; yy266: yych = *++p; if (yych <= 'G') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'H') goto yy41; if (yych == 'h') goto yy41; goto yy31; } yy267: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy268: yych = *++p; if (yych == 'W') goto yy269; if (yych != 'w') goto yy31; yy269: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy270: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy271: yych = *++p; if (yych == 'E') goto yy272; if (yych != 'e') goto yy31; yy272: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy273: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy274: yych = *++p; if (yych <= 'P') { if (yych == 'M') goto yy305; if (yych <= 'O') goto yy31; goto yy304; } else { if (yych <= 'm') { if (yych <= 'l') goto yy31; goto yy305; } else { if (yych == 'p') goto yy304; goto yy31; } } yy275: yych = *++p; if (yych <= 'Q') { if (yych <= '-') { if (yych <= ',') goto yy31; goto yy297; } else { if (yych == 'N') goto yy298; goto yy31; } } else { if (yych <= 'n') { if (yych <= 'R') goto yy296; if (yych <= 'm') goto yy31; goto yy298; } else { if (yych == 'r') goto yy296; goto yy31; } } yy276: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy277: yych = *++p; if (yych == 'S') goto yy292; if (yych == 's') goto yy292; goto yy31; yy278: yych = *++p; switch (yych) { case 'G': case 'g': goto yy283; case 'I': case 'i': goto yy282; case 'P': case 'p': goto yy284; case 'R': case 'r': goto yy285; default: goto yy31; } yy279: yych = *++p; if (yych == 'Q') goto yy281; if (yych == 'q') goto yy281; goto yy31; yy280: yych = *++p; if (yych == 'D') goto yy41; if (yych == 'd') goto yy41; goto yy31; yy281: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy282: yych = *++p; if (yych == 'L') goto yy290; if (yych == 'l') goto yy290; goto yy31; yy283: yych = *++p; if (yych == 'N') goto yy288; if (yych == 'n') goto yy288; goto yy31; yy284: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy285: yych = *++p; if (yych == 'K') goto yy286; if (yych != 'k') goto yy31; yy286: yych = *++p; if (yych == 'E') goto yy287; if (yych != 'e') goto yy31; yy287: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy288: yych = *++p; if (yych == 'E') goto yy289; if (yych != 'e') goto yy31; yy289: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy290: yych = *++p; if (yych == 'T') goto yy291; if (yych != 't') goto yy31; yy291: yych = *++p; if (yych == 'O') goto yy41; if (yych == 'o') goto yy41; goto yy31; yy292: yych = *++p; if (yych == 'S') goto yy293; if (yych != 's') goto yy31; yy293: yych = *++p; if (yych == 'A') goto yy294; if (yych != 'a') goto yy31; yy294: yych = *++p; if (yych == 'G') goto yy295; if (yych != 'g') goto yy31; yy295: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy296: yych = *++p; if (yych == 'P') goto yy303; if (yych == 'p') goto yy303; goto yy31; yy297: yych = *++p; if (yych == 'H') goto yy300; if (yych == 'h') goto yy300; goto yy31; yy298: yych = *++p; if (yych == 'I') goto yy299; if (yych != 'i') goto yy31; yy299: yych = *++p; if (yych == 'M') goto yy41; if (yych == 'm') goto yy41; goto yy31; yy300: yych = *++p; if (yych == 'E') goto yy301; if (yych != 'e') goto yy31; yy301: yych = *++p; if (yych == 'L') goto yy302; if (yych != 'l') goto yy31; yy302: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy303: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy304: yych = *++p; if (yych == 'D') goto yy308; if (yych == 'd') goto yy308; goto yy31; yy305: yych = *++p; if (yych == 'B') goto yy306; if (yych != 'b') goto yy31; yy306: yych = *++p; if (yych == 'L') goto yy307; if (yych != 'l') goto yy31; yy307: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy308: yych = *++p; if (yych == 'A') goto yy309; if (yych != 'a') goto yy31; yy309: yych = *++p; if (yych == 'T') goto yy310; if (yych != 't') goto yy31; yy310: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy311: yych = *++p; if (yych == 'A') goto yy316; if (yych == 'a') goto yy316; goto yy31; yy312: yych = *++p; if (yych == 'S') goto yy313; if (yych != 's') goto yy31; yy313: yych = *++p; if (yych == 'T') goto yy314; if (yych != 't') goto yy31; yy314: yych = *++p; if (yych == 'F') goto yy315; if (yych != 'f') goto yy31; yy315: yych = *++p; if (yych == 'M') goto yy41; if (yych == 'm') goto yy41; goto yy31; yy316: yych = *++p; if (yych == 'P') goto yy317; if (yych != 'p') goto yy31; yy317: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy318: yych = *++p; if (yych == 'M') goto yy341; if (yych == 'm') goto yy341; goto yy31; yy319: yych = *++p; if (yych <= 'I') { if (yych == 'C') goto yy330; if (yych <= 'H') goto yy31; goto yy329; } else { if (yych <= 'c') { if (yych <= 'b') goto yy31; goto yy330; } else { if (yych == 'i') goto yy329; goto yy31; } } yy320: yych = *++p; if (yych <= 'P') { if (yych == 'N') goto yy41; if (yych <= 'O') goto yy31; goto yy41; } else { if (yych <= 'n') { if (yych <= 'm') goto yy31; goto yy41; } else { if (yych == 'p') goto yy41; goto yy31; } } yy321: yych = *++p; if (yych <= 'O') { if (yych == 'A') goto yy327; if (yych <= 'N') goto yy31; goto yy328; } else { if (yych <= 'a') { if (yych <= '`') goto yy31; goto yy327; } else { if (yych == 'o') goto yy328; goto yy31; } } yy322: yych = *++p; if (yych == 'F') goto yy326; if (yych == 'f') goto yy326; goto yy31; yy323: yych = *++p; if (yych <= '@') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'A') goto yy325; if (yych == 'a') goto yy325; goto yy31; } yy324: yych = *++p; if (yych == 'X') goto yy41; if (yych == 'x') goto yy41; goto yy31; yy325: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy326: yych = *++p; if (yych == 'O') goto yy41; if (yych == 'o') goto yy41; goto yy31; yy327: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy328: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy329: yych = *++p; if (yych == 'S') goto yy331; if (yych == 's') goto yy331; goto yy31; yy330: yych = *++p; if (yych <= ':') { if (yych == '6') goto yy41; if (yych <= '9') goto yy31; goto yy42; } else { if (yych <= 'S') { if (yych <= 'R') goto yy31; goto yy41; } else { if (yych == 's') goto yy41; goto yy31; } } yy331: yych = *++p; if (yych == '.') goto yy332; if (yych == ':') goto yy42; goto yy31; yy332: yych = *++p; if (yych <= 'X') { if (yych <= 'K') { if (yych == 'B') goto yy335; goto yy31; } else { if (yych <= 'L') goto yy333; if (yych <= 'W') goto yy31; goto yy334; } } else { if (yych <= 'k') { if (yych == 'b') goto yy335; goto yy31; } else { if (yych <= 'l') goto yy333; if (yych == 'x') goto yy334; goto yy31; } } yy333: yych = *++p; if (yych == 'W') goto yy340; if (yych == 'w') goto yy340; goto yy31; yy334: yych = *++p; if (yych == 'P') goto yy338; if (yych == 'p') goto yy338; goto yy31; yy335: yych = *++p; if (yych == 'E') goto yy336; if (yych != 'e') goto yy31; yy336: yych = *++p; if (yych == 'E') goto yy337; if (yych != 'e') goto yy31; yy337: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy338: yych = *++p; if (yych == 'C') goto yy339; if (yych != 'c') goto yy31; yy339: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy340: yych = *++p; if (yych == 'Z') goto yy41; if (yych == 'z') goto yy41; goto yy31; yy341: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy342: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy343: yych = *++p; if (yych == 'T') goto yy346; if (yych == 't') goto yy346; goto yy31; yy344: yych = *++p; if (yych != '2') goto yy31; yych = *++p; if (yych == '3') goto yy41; goto yy31; yy346: yych = *++p; if (yych == 'P') goto yy347; if (yych != 'p') goto yy31; yy347: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy348: yych = *++p; if (yych == 'A') goto yy364; if (yych == 'a') goto yy364; goto yy31; yy349: yych = *++p; if (yych <= 'Z') { if (yych == 'T') goto yy41; if (yych <= 'Y') goto yy31; goto yy355; } else { if (yych <= 't') { if (yych <= 's') goto yy31; goto yy41; } else { if (yych == 'z') goto yy355; goto yy31; } } yy350: yych = *++p; if (yych <= 'O') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'P') goto yy352; if (yych == 'p') goto yy352; goto yy31; } yy351: yych = *++p; if (yych == 'O') goto yy41; if (yych == 'o') goto yy41; goto yy31; yy352: yych = *++p; if (yych == 'H') goto yy353; if (yych != 'h') goto yy31; yy353: yych = *++p; if (yych == 'E') goto yy354; if (yych != 'e') goto yy31; yy354: yych = *++p; if (yych == 'R') goto yy41; if (yych == 'r') goto yy41; goto yy31; yy355: yych = *++p; if (yych == 'M') goto yy356; if (yych != 'm') goto yy31; yy356: yych = *++p; if (yych == 'O') goto yy357; if (yych != 'o') goto yy31; yy357: yych = *++p; if (yych == 'P') goto yy358; if (yych != 'p') goto yy31; yy358: yych = *++p; if (yych == 'R') goto yy359; if (yych != 'r') goto yy31; yy359: yych = *++p; if (yych == 'O') goto yy360; if (yych != 'o') goto yy31; yy360: yych = *++p; if (yych == 'J') goto yy361; if (yych != 'j') goto yy31; yy361: yych = *++p; if (yych == 'E') goto yy362; if (yych != 'e') goto yy31; yy362: yych = *++p; if (yych == 'C') goto yy363; if (yych != 'c') goto yy31; yy363: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy364: yych = *++p; if (yych == 'L') goto yy365; if (yych != 'l') goto yy31; yy365: yych = *++p; if (yych == 'K') goto yy41; if (yych == 'k') goto yy41; goto yy31; yy366: yych = *++p; if (yych <= 'S') { if (yych <= 'M') { if (yych == 'L') goto yy376; goto yy31; } else { if (yych <= 'N') goto yy377; if (yych <= 'R') goto yy31; goto yy378; } } else { if (yych <= 'm') { if (yych == 'l') goto yy376; goto yy31; } else { if (yych <= 'n') goto yy377; if (yych == 's') goto yy378; goto yy31; } } yy367: yych = *++p; if (yych == 'E') goto yy375; if (yych == 'e') goto yy375; goto yy31; yy368: yych = *++p; if (yych == 'C') goto yy370; if (yych == 'c') goto yy370; goto yy31; yy369: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy370: yych = *++p; if (yych == 'E') goto yy371; if (yych != 'e') goto yy31; yy371: yych = *++p; if (yych == 'T') goto yy372; if (yych != 't') goto yy31; yy372: yych = *++p; if (yych == 'I') goto yy373; if (yych != 'i') goto yy31; yy373: yych = *++p; if (yych == 'M') goto yy374; if (yych != 'm') goto yy31; yy374: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy375: yych = *++p; if (yych == 'D') goto yy41; if (yych == 'd') goto yy41; goto yy31; yy376: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy377: yych = *++p; if (yych == 'G') goto yy379; if (yych == 'g') goto yy379; goto yy31; yy378: yych = *++p; if (yych == 'H') goto yy41; if (yych == 'h') goto yy41; goto yy31; yy379: yych = *++p; if (yych == 'E') goto yy380; if (yych != 'e') goto yy31; yy380: yych = *++p; if (yych == 'R') goto yy41; if (yych == 'r') goto yy41; goto yy31; yy381: yych = *++p; if (yych == 'T') goto yy399; if (yych == 't') goto yy399; goto yy31; yy382: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy383: yych = *++p; if (yych == 'M') goto yy41; if (yych == 'm') goto yy41; goto yy31; yy384: yych = *++p; if (yych <= 'S') { if (yych == 'P') goto yy41; if (yych <= 'R') goto yy31; goto yy41; } else { if (yych <= 'p') { if (yych <= 'o') goto yy31; goto yy41; } else { if (yych == 's') goto yy41; goto yy31; } } yy385: yych = *++p; if (yych == 'I') goto yy393; if (yych == 'i') goto yy393; goto yy31; yy386: yych = *++p; if (yych == 'A') goto yy392; if (yych == 'a') goto yy392; goto yy31; yy387: yych = *++p; if (yych == 'O') goto yy390; if (yych == 'o') goto yy390; goto yy31; yy388: yych = *++p; if (yych == 'A') goto yy389; if (yych != 'a') goto yy31; yy389: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy42; goto yy31; } else { if (yych <= 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; } yy390: yych = *++p; if (yych == 'U') goto yy391; if (yych != 'u') goto yy31; yy391: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy392: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy393: yych = *++p; if (yych == 'U') goto yy394; if (yych != 'u') goto yy31; yy394: yych = *++p; if (yych == 'M') goto yy395; if (yych != 'm') goto yy31; yy395: yych = *++p; if (yych == 'X') goto yy396; if (yych != 'x') goto yy31; yy396: yych = *++p; if (yych == 'T') goto yy397; if (yych != 't') goto yy31; yy397: yych = *++p; if (yych == 'R') goto yy398; if (yych != 'r') goto yy31; yy398: yych = *++p; if (yych == 'A') goto yy41; if (yych == 'a') goto yy41; goto yy31; yy399: yych = *++p; if (yych == 'A') goto yy400; if (yych != 'a') goto yy31; yy400: yych = *++p; if (yych == 'C') goto yy401; if (yych != 'c') goto yy31; yy401: yych = *++p; if (yych == 'H') goto yy402; if (yych != 'h') goto yy31; yy402: yych = *++p; if (yych == 'M') goto yy403; if (yych != 'm') goto yy31; yy403: yych = *++p; if (yych == 'E') goto yy404; if (yych != 'e') goto yy31; yy404: yych = *++p; if (yych == 'N') goto yy405; if (yych != 'n') goto yy31; yy405: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy406: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy407: yych = *++p; if (yych <= 'V') { if (yych == 'R') goto yy41; if (yych <= 'U') goto yy31; } else { if (yych <= 'r') { if (yych <= 'q') goto yy31; goto yy41; } else { if (yych != 'v') goto yy31; } } yych = *++p; if (yych == 'A') goto yy409; if (yych != 'a') goto yy31; yy409: yych = *++p; if (yych == 'S') goto yy410; if (yych != 's') goto yy31; yy410: yych = *++p; if (yych == 'C') goto yy411; if (yych != 'c') goto yy31; yy411: yych = *++p; if (yych == 'R') goto yy412; if (yych != 'r') goto yy31; yy412: yych = *++p; if (yych == 'I') goto yy413; if (yych != 'i') goto yy31; yy413: yych = *++p; if (yych == 'P') goto yy414; if (yych != 'p') goto yy31; yy414: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy415: yych = *++p; if (yych == 'B') goto yy41; if (yych == 'b') goto yy41; goto yy31; yy416: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy417: yych = *++p; if (yych == 'N') goto yy424; if (yych == 'n') goto yy424; goto yy31; yy418: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy419: yych = *++p; if (yych == 'C') goto yy423; if (yych == 'c') goto yy423; goto yy31; yy420: yych = *++p; if (yych <= 'V') { if (yych == 'T') goto yy422; if (yych <= 'U') goto yy31; goto yy41; } else { if (yych <= 't') { if (yych <= 's') goto yy31; goto yy422; } else { if (yych == 'v') goto yy41; goto yy31; } } yy421: yych = *++p; if (yych == 'I') goto yy41; if (yych == 'i') goto yy41; goto yy31; yy422: yych = *++p; if (yych == 'A') goto yy41; if (yych == 'a') goto yy41; goto yy31; yy423: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy424: yych = *++p; if (yych == 'A') goto yy425; if (yych != 'a') goto yy31; yy425: yych = *++p; if (yych != '-') goto yy31; yych = *++p; if (yych == 'P') goto yy427; if (yych != 'p') goto yy31; yy427: yych = *++p; if (yych == 'L') goto yy428; if (yych != 'l') goto yy31; yy428: yych = *++p; if (yych == 'A') goto yy429; if (yych != 'a') goto yy31; yy429: yych = *++p; if (yych == 'Y') goto yy430; if (yych != 'y') goto yy31; yy430: yych = *++p; if (yych <= 'S') { if (yych == 'C') goto yy431; if (yych <= 'R') goto yy31; goto yy432; } else { if (yych <= 'c') { if (yych <= 'b') goto yy31; } else { if (yych == 's') goto yy432; goto yy31; } } yy431: yych = *++p; if (yych == 'O') goto yy437; if (yych == 'o') goto yy437; goto yy31; yy432: yych = *++p; if (yych == 'I') goto yy433; if (yych != 'i') goto yy31; yy433: yych = *++p; if (yych == 'N') goto yy434; if (yych != 'n') goto yy31; yy434: yych = *++p; if (yych == 'G') goto yy435; if (yych != 'g') goto yy31; yy435: yych = *++p; if (yych == 'L') goto yy436; if (yych != 'l') goto yy31; yy436: yych = *++p; if (yych == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; yy437: yych = *++p; if (yych == 'N') goto yy438; if (yych != 'n') goto yy31; yy438: yych = *++p; if (yych == 'T') goto yy439; if (yych != 't') goto yy31; yy439: yych = *++p; if (yych == 'A') goto yy440; if (yych != 'a') goto yy31; yy440: yych = *++p; if (yych == 'I') goto yy441; if (yych != 'i') goto yy31; yy441: yych = *++p; if (yych == 'N') goto yy442; if (yych != 'n') goto yy31; yy442: yych = *++p; if (yych == 'E') goto yy443; if (yych != 'e') goto yy31; yy443: yych = *++p; if (yych == 'R') goto yy41; if (yych == 'r') goto yy41; goto yy31; yy444: yych = *++p; if (yych == 'S') goto yy41; if (yych == 's') goto yy41; goto yy31; yy445: yych = *++p; if (yych <= 'N') { if (yych <= 'A') { if (yych <= '@') goto yy31; goto yy467; } else { if (yych <= 'L') goto yy31; if (yych <= 'M') goto yy468; goto yy469; } } else { if (yych <= 'l') { if (yych == 'a') goto yy467; goto yy31; } else { if (yych <= 'm') goto yy468; if (yych <= 'n') goto yy469; goto yy31; } } yy446: yych = *++p; if (yych == 'R') goto yy454; if (yych == 'r') goto yy454; goto yy31; yy447: yych = *++p; if (yych <= 'P') { if (yych == 'L') goto yy451; if (yych <= 'O') goto yy31; goto yy41; } else { if (yych <= 'l') { if (yych <= 'k') goto yy31; goto yy451; } else { if (yych == 'p') goto yy41; goto yy31; } } yy448: yych = *++p; if (yych == 'I') goto yy450; if (yych == 'i') goto yy450; goto yy31; yy449: yych = *++p; if (yych == 'D') goto yy41; if (yych == 'd') goto yy41; goto yy31; yy450: yych = *++p; if (yych == 'D') goto yy41; if (yych == 'd') goto yy41; goto yy31; yy451: yych = *++p; if (yych == 'L') goto yy452; if (yych != 'l') goto yy31; yy452: yych = *++p; if (yych == 'T') goto yy453; if (yych != 't') goto yy31; yy453: yych = *++p; if (yych == 'O') goto yy41; if (yych == 'o') goto yy41; goto yy31; yy454: yych = *++p; if (yych == 'O') goto yy455; if (yych != 'o') goto yy31; yy455: yych = *++p; if (yych == 'M') goto yy456; if (yych != 'm') goto yy31; yy456: yych = *++p; if (yych == 'E') goto yy457; if (yych != 'e') goto yy31; yy457: yych = *++p; if (yych == '-') goto yy458; if (yych == ':') goto yy42; goto yy31; yy458: yych = *++p; if (yych == 'E') goto yy459; if (yych != 'e') goto yy31; yy459: yych = *++p; if (yych == 'X') goto yy460; if (yych != 'x') goto yy31; yy460: yych = *++p; if (yych == 'T') goto yy461; if (yych != 't') goto yy31; yy461: yych = *++p; if (yych == 'E') goto yy462; if (yych != 'e') goto yy31; yy462: yych = *++p; if (yych == 'N') goto yy463; if (yych != 'n') goto yy31; yy463: yych = *++p; if (yych == 'S') goto yy464; if (yych != 's') goto yy31; yy464: yych = *++p; if (yych == 'I') goto yy465; if (yych != 'i') goto yy31; yy465: yych = *++p; if (yych == 'O') goto yy466; if (yych != 'o') goto yy31; yy466: yych = *++p; if (yych == 'N') goto yy41; if (yych == 'n') goto yy41; goto yy31; yy467: yych = *++p; if (yych == 'P') goto yy41; if (yych == 'p') goto yy41; goto yy31; yy468: yych = *++p; if (yych == '-') goto yy473; goto yy31; yy469: yych = *++p; if (yych == 'T') goto yy470; if (yych != 't') goto yy31; yy470: yych = *++p; if (yych == 'E') goto yy471; if (yych != 'e') goto yy31; yy471: yych = *++p; if (yych == 'N') goto yy472; if (yych != 'n') goto yy31; yy472: yych = *++p; if (yych == 'T') goto yy41; if (yych == 't') goto yy41; goto yy31; yy473: yych = *++p; if (yych == 'E') goto yy474; if (yych != 'e') goto yy31; yy474: yych = *++p; if (yych == 'V') goto yy475; if (yych != 'v') goto yy31; yy475: yych = *++p; if (yych == 'E') goto yy476; if (yych != 'e') goto yy31; yy476: yych = *++p; if (yych == 'N') goto yy477; if (yych != 'n') goto yy31; yy477: yych = *++p; if (yych == 'T') goto yy478; if (yych != 't') goto yy31; yy478: yych = *++p; if (yych == 'B') goto yy479; if (yych != 'b') goto yy31; yy479: yych = *++p; if (yych == 'R') goto yy480; if (yych != 'r') goto yy31; yy480: yych = *++p; if (yych == 'I') goto yy481; if (yych != 'i') goto yy31; yy481: yych = *++p; if (yych == 'T') goto yy482; if (yych != 't') goto yy31; yy482: yych = *++p; if (yych == 'E') goto yy483; if (yych != 'e') goto yy31; yy483: yych = *++p; if (yych != '-') goto yy31; yych = *++p; if (yych == 'A') goto yy485; if (yych != 'a') goto yy31; yy485: yych = *++p; if (yych == 'T') goto yy486; if (yych != 't') goto yy31; yy486: yych = *++p; if (yych == 'T') goto yy487; if (yych != 't') goto yy31; yy487: yych = *++p; if (yych == 'E') goto yy488; if (yych != 'e') goto yy31; yy488: yych = *++p; if (yych == 'N') goto yy489; if (yych != 'n') goto yy31; yy489: yych = *++p; if (yych == 'D') goto yy490; if (yych != 'd') goto yy31; yy490: yych = *++p; if (yych == 'E') goto yy491; if (yych != 'e') goto yy31; yy491: ++p; if ((yych = *p) == 'E') goto yy41; if (yych == 'e') goto yy41; goto yy31; } } // Try to match URI autolink after first <, returning number of chars matched. bufsize_t _scan_autolink_uri(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 'c') { if (yych <= 'M') { if (yych <= 'E') { if (yych <= 'A') { if (yych == '\n') goto yy494; if (yych <= '@') goto yy521; goto yy498; } else { if (yych <= 'B') goto yy516; if (yych <= 'C') goto yy495; if (yych <= 'D') goto yy496; goto yy517; } } else { if (yych <= 'I') { if (yych <= 'F') goto yy499; if (yych <= 'G') goto yy500; if (yych <= 'H') goto yy501; goto yy502; } else { if (yych <= 'J') goto yy497; if (yych <= 'K') goto yy518; if (yych <= 'L') goto yy503; goto yy504; } } } else { if (yych <= 'U') { if (yych <= 'Q') { if (yych <= 'N') goto yy505; if (yych <= 'O') goto yy506; if (yych <= 'P') goto yy507; goto yy519; } else { if (yych <= 'R') goto yy508; if (yych <= 'S') goto yy509; if (yych <= 'T') goto yy510; goto yy511; } } else { if (yych <= 'Y') { if (yych <= 'V') goto yy512; if (yych <= 'W') goto yy513; if (yych <= 'X') goto yy514; goto yy520; } else { if (yych <= '`') { if (yych <= 'Z') goto yy515; goto yy521; } else { if (yych <= 'a') goto yy498; if (yych <= 'b') goto yy516; goto yy495; } } } } } else { if (yych <= 't') { if (yych <= 'k') { if (yych <= 'g') { if (yych <= 'd') goto yy496; if (yych <= 'e') goto yy517; if (yych <= 'f') goto yy499; goto yy500; } else { if (yych <= 'h') goto yy501; if (yych <= 'i') goto yy502; if (yych <= 'j') goto yy497; goto yy518; } } else { if (yych <= 'o') { if (yych <= 'l') goto yy503; if (yych <= 'm') goto yy504; if (yych <= 'n') goto yy505; goto yy506; } else { if (yych <= 'q') { if (yych <= 'p') goto yy507; goto yy519; } else { if (yych <= 'r') goto yy508; if (yych <= 's') goto yy509; goto yy510; } } } } else { if (yych <= 0xC1) { if (yych <= 'x') { if (yych <= 'u') goto yy511; if (yych <= 'v') goto yy512; if (yych <= 'w') goto yy513; goto yy514; } else { if (yych <= 'y') goto yy520; if (yych <= 'z') goto yy515; if (yych <= 0x7F) goto yy521; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy522; if (yych <= 0xE0) goto yy524; if (yych <= 0xEC) goto yy525; goto yy529; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy525; goto yy526; } else { if (yych <= 0xF3) goto yy527; if (yych <= 0xF4) goto yy528; } } } } } yy494 : { return 0; } yy495: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy948; case 'H': case 'h': goto yy947; case 'I': case 'i': goto yy950; case 'O': case 'o': goto yy946; case 'R': case 'r': goto yy949; case 'V': case 'v': goto yy945; default: goto yy494; } yy496: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy921; case 'I': case 'i': goto yy920; case 'L': case 'l': goto yy918; case 'N': case 'n': goto yy919; case 'O': case 'o': goto yy922; case 'T': case 't': goto yy917; case 'V': case 'v': goto yy916; default: goto yy494; } yy497: yych = *(marker = ++p); if (yych <= 'M') { if (yych == 'A') goto yy908; if (yych <= 'L') goto yy494; goto yy907; } else { if (yych <= 'a') { if (yych <= '`') goto yy494; goto yy908; } else { if (yych == 'm') goto yy907; goto yy494; } } yy498: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy889; case 'B': case 'b': goto yy888; case 'C': case 'c': goto yy887; case 'D': case 'd': goto yy886; case 'F': case 'f': goto yy885; case 'I': case 'i': goto yy884; case 'P': case 'p': goto yy883; case 'T': case 't': goto yy882; case 'W': case 'w': goto yy533; default: goto yy494; } yy499: yych = *(marker = ++p); if (yych <= 'T') { if (yych <= 'E') { if (yych == 'A') goto yy869; if (yych <= 'D') goto yy494; goto yy868; } else { if (yych == 'I') goto yy867; if (yych <= 'S') goto yy494; goto yy870; } } else { if (yych <= 'e') { if (yych == 'a') goto yy869; if (yych <= 'd') goto yy494; goto yy868; } else { if (yych <= 'i') { if (yych <= 'h') goto yy494; goto yy867; } else { if (yych == 't') goto yy870; goto yy494; } } } yy500: yych = *(marker = ++p); switch (yych) { case 'E': case 'e': goto yy852; case 'G': case 'g': goto yy533; case 'I': case 'i': goto yy850; case 'O': case 'o': goto yy851; case 'T': case 't': goto yy849; default: goto yy494; } yy501: yych = *(marker = ++p); if (yych <= 'S') { if (yych <= '3') { if (yych <= '2') goto yy494; goto yy845; } else { if (yych == 'C') goto yy843; goto yy494; } } else { if (yych <= 'c') { if (yych <= 'T') goto yy844; if (yych <= 'b') goto yy494; goto yy843; } else { if (yych == 't') goto yy844; goto yy494; } } yy502: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy825; case 'C': case 'c': goto yy822; case 'M': case 'm': goto yy824; case 'N': case 'n': goto yy823; case 'P': case 'p': goto yy821; case 'R': case 'r': goto yy820; case 'T': case 't': goto yy819; default: goto yy494; } yy503: yych = *(marker = ++p); if (yych <= 'D') { if (yych == 'A') goto yy813; if (yych <= 'C') goto yy494; goto yy812; } else { if (yych <= 'a') { if (yych <= '`') goto yy494; goto yy813; } else { if (yych == 'd') goto yy812; goto yy494; } } yy504: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy779; case 'E': case 'e': goto yy778; case 'I': case 'i': goto yy781; case 'M': case 'm': goto yy777; case 'S': case 's': goto yy776; case 'T': case 't': goto yy780; case 'U': case 'u': goto yy775; case 'V': case 'v': goto yy774; default: goto yy494; } yy505: yych = *(marker = ++p); switch (yych) { case 'E': case 'e': goto yy769; case 'F': case 'f': goto yy768; case 'I': case 'i': goto yy767; case 'N': case 'n': goto yy766; case 'O': case 'o': goto yy765; default: goto yy494; } yy506: yych = *(marker = ++p); if (yych <= 'P') { if (yych == 'I') goto yy751; if (yych <= 'O') goto yy494; goto yy752; } else { if (yych <= 'i') { if (yych <= 'h') goto yy494; goto yy751; } else { if (yych == 'p') goto yy752; goto yy494; } } yy507: yych = *(marker = ++p); if (yych <= 'S') { if (yych <= 'L') { if (yych == 'A') goto yy733; if (yych <= 'K') goto yy494; goto yy732; } else { if (yych <= 'O') { if (yych <= 'N') goto yy494; goto yy734; } else { if (yych <= 'Q') goto yy494; if (yych <= 'R') goto yy731; goto yy730; } } } else { if (yych <= 'n') { if (yych <= 'a') { if (yych <= '`') goto yy494; goto yy733; } else { if (yych == 'l') goto yy732; goto yy494; } } else { if (yych <= 'q') { if (yych <= 'o') goto yy734; goto yy494; } else { if (yych <= 'r') goto yy731; if (yych <= 's') goto yy730; goto yy494; } } } yy508: yych = *(marker = ++p); if (yych <= 'T') { if (yych <= 'L') { if (yych == 'E') goto yy720; goto yy494; } else { if (yych <= 'M') goto yy719; if (yych <= 'R') goto yy494; if (yych <= 'S') goto yy718; goto yy717; } } else { if (yych <= 'm') { if (yych == 'e') goto yy720; if (yych <= 'l') goto yy494; goto yy719; } else { if (yych <= 'r') goto yy494; if (yych <= 's') goto yy718; if (yych <= 't') goto yy717; goto yy494; } } yy509: yych = *(marker = ++p); switch (yych) { case 'E': case 'e': goto yy673; case 'F': case 'f': goto yy672; case 'G': case 'g': goto yy671; case 'H': case 'h': goto yy676; case 'I': case 'i': goto yy675; case 'K': case 'k': goto yy670; case 'M': case 'm': goto yy669; case 'N': case 'n': goto yy674; case 'O': case 'o': goto yy668; case 'P': case 'p': goto yy667; case 'S': case 's': goto yy666; case 'T': case 't': goto yy665; case 'V': case 'v': goto yy664; default: goto yy494; } yy510: yych = *(marker = ++p); switch (yych) { case 'A': case 'a': goto yy640; case 'E': case 'e': goto yy636; case 'F': case 'f': goto yy639; case 'H': case 'h': goto yy635; case 'I': case 'i': goto yy637; case 'N': case 'n': goto yy638; case 'V': case 'v': goto yy533; default: goto yy494; } yy511: yych = *(marker = ++p); if (yych <= 'T') { if (yych <= 'N') { if (yych == 'D') goto yy627; if (yych <= 'M') goto yy494; goto yy626; } else { if (yych == 'R') goto yy628; if (yych <= 'S') goto yy494; goto yy625; } } else { if (yych <= 'n') { if (yych == 'd') goto yy627; if (yych <= 'm') goto yy494; goto yy626; } else { if (yych <= 'r') { if (yych <= 'q') goto yy494; goto yy628; } else { if (yych == 't') goto yy625; goto yy494; } } } yy512: yych = *(marker = ++p); if (yych <= 'I') { if (yych == 'E') goto yy609; if (yych <= 'H') goto yy494; goto yy608; } else { if (yych <= 'e') { if (yych <= 'd') goto yy494; goto yy609; } else { if (yych == 'i') goto yy608; goto yy494; } } yy513: yych = *(marker = ++p); if (yych <= 'Y') { if (yych <= 'R') { if (yych == 'E') goto yy598; goto yy494; } else { if (yych <= 'S') goto yy599; if (yych <= 'T') goto yy597; if (yych <= 'X') goto yy494; goto yy596; } } else { if (yych <= 's') { if (yych == 'e') goto yy598; if (yych <= 'r') goto yy494; goto yy599; } else { if (yych <= 't') goto yy597; if (yych == 'y') goto yy596; goto yy494; } } yy514: yych = *(marker = ++p); if (yych <= 'R') { if (yych <= 'F') { if (yych == 'C') goto yy575; if (yych <= 'E') goto yy494; goto yy573; } else { if (yych == 'M') goto yy574; if (yych <= 'Q') goto yy494; goto yy572; } } else { if (yych <= 'f') { if (yych == 'c') goto yy575; if (yych <= 'e') goto yy494; goto yy573; } else { if (yych <= 'm') { if (yych <= 'l') goto yy494; goto yy574; } else { if (yych == 'r') goto yy572; goto yy494; } } } yy515: yych = *(marker = ++p); if (yych == '3') goto yy567; goto yy494; yy516: yych = *(marker = ++p); if (yych <= 'O') { if (yych <= 'H') { if (yych == 'E') goto yy557; goto yy494; } else { if (yych <= 'I') goto yy556; if (yych <= 'N') goto yy494; goto yy555; } } else { if (yych <= 'h') { if (yych == 'e') goto yy557; goto yy494; } else { if (yych <= 'i') goto yy556; if (yych == 'o') goto yy555; goto yy494; } } yy517: yych = *(marker = ++p); if (yych == 'D') goto yy553; if (yych == 'd') goto yy553; goto yy494; yy518: yych = *(marker = ++p); if (yych == 'E') goto yy548; if (yych == 'e') goto yy548; goto yy494; yy519: yych = *(marker = ++p); if (yych == 'U') goto yy545; if (yych == 'u') goto yy545; goto yy494; yy520: yych = *(marker = ++p); if (yych == 'M') goto yy530; if (yych == 'm') goto yy530; goto yy494; yy521: yych = *++p; goto yy494; yy522: yych = *++p; if (yych <= 0x7F) goto yy523; if (yych <= 0xBF) goto yy521; yy523: p = marker; goto yy494; yy524: yych = *++p; if (yych <= 0x9F) goto yy523; if (yych <= 0xBF) goto yy522; goto yy523; yy525: yych = *++p; if (yych <= 0x7F) goto yy523; if (yych <= 0xBF) goto yy522; goto yy523; yy526: yych = *++p; if (yych <= 0x8F) goto yy523; if (yych <= 0xBF) goto yy525; goto yy523; yy527: yych = *++p; if (yych <= 0x7F) goto yy523; if (yych <= 0xBF) goto yy525; goto yy523; yy528: yych = *++p; if (yych <= 0x7F) goto yy523; if (yych <= 0x8F) goto yy525; goto yy523; yy529: yych = *++p; if (yych <= 0x7F) goto yy523; if (yych <= 0x9F) goto yy522; goto yy523; yy530: yych = *++p; if (yych == 'S') goto yy531; if (yych != 's') goto yy523; yy531: yych = *++p; if (yych == 'G') goto yy532; if (yych != 'g') goto yy523; yy532: yych = *++p; if (yych == 'R') goto yy533; if (yych != 'r') goto yy523; yy533: yych = *++p; if (yych != ':') goto yy523; yy534: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy534; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '<') goto yy523; if (yych <= '>') goto yy543; goto yy523; } else { if (yych <= 0xDF) goto yy536; if (yych <= 0xE0) goto yy537; goto yy538; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy542; if (yych <= 0xEF) goto yy538; goto yy539; } else { if (yych <= 0xF3) goto yy540; if (yych <= 0xF4) goto yy541; goto yy523; } } yy536: ++p; yych = *p; if (yych <= 0x7F) goto yy523; if (yych <= 0xBF) goto yy534; goto yy523; yy537: ++p; yych = *p; if (yych <= 0x9F) goto yy523; if (yych <= 0xBF) goto yy536; goto yy523; yy538: ++p; yych = *p; if (yych <= 0x7F) goto yy523; if (yych <= 0xBF) goto yy536; goto yy523; yy539: ++p; yych = *p; if (yych <= 0x8F) goto yy523; if (yych <= 0xBF) goto yy538; goto yy523; yy540: ++p; yych = *p; if (yych <= 0x7F) goto yy523; if (yych <= 0xBF) goto yy538; goto yy523; yy541: ++p; yych = *p; if (yych <= 0x7F) goto yy523; if (yych <= 0x8F) goto yy538; goto yy523; yy542: ++p; yych = *p; if (yych <= 0x7F) goto yy523; if (yych <= 0x9F) goto yy536; goto yy523; yy543: ++p; { return (bufsize_t)(p - start); } yy545: yych = *++p; if (yych == 'E') goto yy546; if (yych != 'e') goto yy523; yy546: yych = *++p; if (yych == 'R') goto yy547; if (yych != 'r') goto yy523; yy547: yych = *++p; if (yych == 'Y') goto yy533; if (yych == 'y') goto yy533; goto yy523; yy548: yych = *++p; if (yych == 'Y') goto yy549; if (yych != 'y') goto yy523; yy549: yych = *++p; if (yych == 'P') goto yy550; if (yych != 'p') goto yy523; yy550: yych = *++p; if (yych == 'A') goto yy551; if (yych != 'a') goto yy523; yy551: yych = *++p; if (yych == 'R') goto yy552; if (yych != 'r') goto yy523; yy552: yych = *++p; if (yych == 'C') goto yy533; if (yych == 'c') goto yy533; goto yy523; yy553: yych = *++p; if (yych != '2') goto yy523; yych = *++p; if (yych == 'K') goto yy533; if (yych == 'k') goto yy533; goto yy523; yy555: yych = *++p; if (yych == 'L') goto yy566; if (yych == 'l') goto yy566; goto yy523; yy556: yych = *++p; if (yych == 'T') goto yy562; if (yych == 't') goto yy562; goto yy523; yy557: yych = *++p; if (yych == 'S') goto yy558; if (yych != 's') goto yy523; yy558: yych = *++p; if (yych == 'H') goto yy559; if (yych != 'h') goto yy523; yy559: yych = *++p; if (yych == 'A') goto yy560; if (yych != 'a') goto yy523; yy560: yych = *++p; if (yych == 'R') goto yy561; if (yych != 'r') goto yy523; yy561: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy562: yych = *++p; if (yych == 'C') goto yy563; if (yych != 'c') goto yy523; yy563: yych = *++p; if (yych == 'O') goto yy564; if (yych != 'o') goto yy523; yy564: yych = *++p; if (yych == 'I') goto yy565; if (yych != 'i') goto yy523; yy565: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy566: yych = *++p; if (yych == 'O') goto yy533; if (yych == 'o') goto yy533; goto yy523; yy567: yych = *++p; if (yych != '9') goto yy523; yych = *++p; if (yych != '.') goto yy523; yych = *++p; if (yych != '5') goto yy523; yych = *++p; if (yych != '0') goto yy523; yych = *++p; if (yych <= 'Q') goto yy523; if (yych <= 'S') goto yy533; if (yych <= 'q') goto yy523; if (yych <= 's') goto yy533; goto yy523; yy572: yych = *++p; if (yych == 'I') goto yy533; if (yych == 'i') goto yy533; goto yy523; yy573: yych = *++p; if (yych == 'I') goto yy594; if (yych == 'i') goto yy594; goto yy523; yy574: yych = *++p; if (yych <= 'P') { if (yych == 'L') goto yy584; if (yych <= 'O') goto yy523; goto yy585; } else { if (yych <= 'l') { if (yych <= 'k') goto yy523; goto yy584; } else { if (yych == 'p') goto yy585; goto yy523; } } yy575: yych = *++p; if (yych == 'O') goto yy576; if (yych != 'o') goto yy523; yy576: yych = *++p; if (yych == 'N') goto yy577; if (yych != 'n') goto yy523; yy577: yych = *++p; if (yych == '-') goto yy578; if (yych == ':') goto yy534; goto yy523; yy578: yych = *++p; if (yych == 'U') goto yy579; if (yych != 'u') goto yy523; yy579: yych = *++p; if (yych == 'S') goto yy580; if (yych != 's') goto yy523; yy580: yych = *++p; if (yych == 'E') goto yy581; if (yych != 'e') goto yy523; yy581: yych = *++p; if (yych == 'R') goto yy582; if (yych != 'r') goto yy523; yy582: yych = *++p; if (yych == 'I') goto yy583; if (yych != 'i') goto yy523; yy583: yych = *++p; if (yych == 'D') goto yy533; if (yych == 'd') goto yy533; goto yy523; yy584: yych = *++p; if (yych == 'R') goto yy586; if (yych == 'r') goto yy586; goto yy523; yy585: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy586: yych = *++p; if (yych == 'P') goto yy587; if (yych != 'p') goto yy523; yy587: yych = *++p; if (yych == 'C') goto yy588; if (yych != 'c') goto yy523; yy588: yych = *++p; if (yych != '.') goto yy523; yych = *++p; if (yych == 'B') goto yy590; if (yych != 'b') goto yy523; yy590: yych = *++p; if (yych == 'E') goto yy591; if (yych != 'e') goto yy523; yy591: yych = *++p; if (yych == 'E') goto yy592; if (yych != 'e') goto yy523; yy592: yych = *++p; if (yych == 'P') goto yy593; if (yych != 'p') goto yy523; yy593: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy594: yych = *++p; if (yych == 'R') goto yy595; if (yych != 'r') goto yy523; yy595: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy596: yych = *++p; if (yych == 'C') goto yy604; if (yych == 'c') goto yy604; goto yy523; yy597: yych = *++p; if (yych == 'A') goto yy603; if (yych == 'a') goto yy603; goto yy523; yy598: yych = *++p; if (yych == 'B') goto yy600; if (yych == 'b') goto yy600; goto yy523; yy599: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy600: yych = *++p; if (yych == 'C') goto yy601; if (yych != 'c') goto yy523; yy601: yych = *++p; if (yych == 'A') goto yy602; if (yych != 'a') goto yy523; yy602: yych = *++p; if (yych == 'L') goto yy533; if (yych == 'l') goto yy533; goto yy523; yy603: yych = *++p; if (yych == 'I') goto yy533; if (yych == 'i') goto yy533; goto yy523; yy604: yych = *++p; if (yych == 'I') goto yy605; if (yych != 'i') goto yy523; yy605: yych = *++p; if (yych == 'W') goto yy606; if (yych != 'w') goto yy523; yy606: yych = *++p; if (yych == 'Y') goto yy607; if (yych != 'y') goto yy523; yy607: yych = *++p; if (yych == 'G') goto yy533; if (yych == 'g') goto yy533; goto yy523; yy608: yych = *++p; if (yych == 'E') goto yy617; if (yych == 'e') goto yy617; goto yy523; yy609: yych = *++p; if (yych <= 'N') { if (yych <= 'L') goto yy523; if (yych >= 'N') goto yy611; } else { if (yych <= 'l') goto yy523; if (yych <= 'm') goto yy610; if (yych <= 'n') goto yy611; goto yy523; } yy610: yych = *++p; if (yych == 'M') goto yy616; if (yych == 'm') goto yy616; goto yy523; yy611: yych = *++p; if (yych == 'T') goto yy612; if (yych != 't') goto yy523; yy612: yych = *++p; if (yych == 'R') goto yy613; if (yych != 'r') goto yy523; yy613: yych = *++p; if (yych == 'I') goto yy614; if (yych != 'i') goto yy523; yy614: yych = *++p; if (yych == 'L') goto yy615; if (yych != 'l') goto yy523; yy615: yych = *++p; if (yych == 'O') goto yy533; if (yych == 'o') goto yy533; goto yy523; yy616: yych = *++p; if (yych == 'I') goto yy533; if (yych == 'i') goto yy533; goto yy523; yy617: yych = *++p; if (yych == 'W') goto yy618; if (yych != 'w') goto yy523; yy618: yych = *++p; if (yych != '-') goto yy523; yych = *++p; if (yych == 'S') goto yy620; if (yych != 's') goto yy523; yy620: yych = *++p; if (yych == 'O') goto yy621; if (yych != 'o') goto yy523; yy621: yych = *++p; if (yych == 'U') goto yy622; if (yych != 'u') goto yy523; yy622: yych = *++p; if (yych == 'R') goto yy623; if (yych != 'r') goto yy523; yy623: yych = *++p; if (yych == 'C') goto yy624; if (yych != 'c') goto yy523; yy624: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy625: yych = *++p; if (yych == '2') goto yy632; goto yy523; yy626: yych = *++p; if (yych == 'R') goto yy629; if (yych == 'r') goto yy629; goto yy523; yy627: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy628: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy629: yych = *++p; if (yych == 'E') goto yy630; if (yych != 'e') goto yy523; yy630: yych = *++p; if (yych == 'A') goto yy631; if (yych != 'a') goto yy523; yy631: yych = *++p; if (yych == 'L') goto yy533; if (yych == 'l') goto yy533; goto yy523; yy632: yych = *++p; if (yych != '0') goto yy523; yych = *++p; if (yych != '0') goto yy523; yych = *++p; if (yych == '4') goto yy533; goto yy523; yy635: yych = *++p; if (yych == 'I') goto yy654; if (yych == 'i') goto yy654; goto yy523; yy636: yych = *++p; if (yych <= 'L') { if (yych == 'A') goto yy646; if (yych <= 'K') goto yy523; goto yy645; } else { if (yych <= 'a') { if (yych <= '`') goto yy523; goto yy646; } else { if (yych == 'l') goto yy645; goto yy523; } } yy637: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy638: yych = *++p; if (yych == '3') goto yy642; goto yy523; yy639: yych = *++p; if (yych == 'T') goto yy641; if (yych == 't') goto yy641; goto yy523; yy640: yych = *++p; if (yych == 'G') goto yy533; if (yych == 'g') goto yy533; goto yy523; yy641: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy642: yych = *++p; if (yych != '2') goto yy523; yych = *++p; if (yych != '7') goto yy523; yych = *++p; if (yych == '0') goto yy533; goto yy523; yy645: yych = *++p; if (yych <= 'M') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'N') goto yy652; if (yych == 'n') goto yy652; goto yy523; } yy646: yych = *++p; if (yych == 'M') goto yy647; if (yych != 'm') goto yy523; yy647: yych = *++p; if (yych == 'S') goto yy648; if (yych != 's') goto yy523; yy648: yych = *++p; if (yych == 'P') goto yy649; if (yych != 'p') goto yy523; yy649: yych = *++p; if (yych == 'E') goto yy650; if (yych != 'e') goto yy523; yy650: yych = *++p; if (yych == 'A') goto yy651; if (yych != 'a') goto yy523; yy651: yych = *++p; if (yych == 'K') goto yy533; if (yych == 'k') goto yy533; goto yy523; yy652: yych = *++p; if (yych == 'E') goto yy653; if (yych != 'e') goto yy523; yy653: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy654: yych = *++p; if (yych <= 'S') { if (yych == 'N') goto yy655; if (yych <= 'R') goto yy523; goto yy656; } else { if (yych <= 'n') { if (yych <= 'm') goto yy523; } else { if (yych == 's') goto yy656; goto yy523; } } yy655: yych = *++p; if (yych == 'G') goto yy663; if (yych == 'g') goto yy663; goto yy523; yy656: yych = *++p; if (yych == 'M') goto yy657; if (yych != 'm') goto yy523; yy657: yych = *++p; if (yych == 'E') goto yy658; if (yych != 'e') goto yy523; yy658: yych = *++p; if (yych == 'S') goto yy659; if (yych != 's') goto yy523; yy659: yych = *++p; if (yych == 'S') goto yy660; if (yych != 's') goto yy523; yy660: yych = *++p; if (yych == 'A') goto yy661; if (yych != 'a') goto yy523; yy661: yych = *++p; if (yych == 'G') goto yy662; if (yych != 'g') goto yy523; yy662: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy663: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy664: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy665: yych = *++p; if (yych == 'E') goto yy715; if (yych == 'e') goto yy715; goto yy523; yy666: yych = *++p; if (yych == 'H') goto yy533; if (yych == 'h') goto yy533; goto yy523; yy667: yych = *++p; if (yych == 'O') goto yy711; if (yych == 'o') goto yy711; goto yy523; yy668: yych = *++p; if (yych <= 'L') { if (yych == 'A') goto yy701; if (yych <= 'K') goto yy523; goto yy702; } else { if (yych <= 'a') { if (yych <= '`') goto yy523; goto yy701; } else { if (yych == 'l') goto yy702; goto yy523; } } yy669: yych = *++p; if (yych <= 'S') { if (yych == 'B') goto yy533; if (yych <= 'R') goto yy523; goto yy533; } else { if (yych <= 'b') { if (yych <= 'a') goto yy523; goto yy533; } else { if (yych == 's') goto yy533; goto yy523; } } yy670: yych = *++p; if (yych == 'Y') goto yy699; if (yych == 'y') goto yy699; goto yy523; yy671: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy672: yych = *++p; if (yych == 'T') goto yy698; if (yych == 't') goto yy698; goto yy523; yy673: yych = *++p; if (yych <= 'S') { if (yych <= 'C') { if (yych <= 'B') goto yy523; goto yy685; } else { if (yych <= 'Q') goto yy523; if (yych <= 'R') goto yy683; goto yy684; } } else { if (yych <= 'q') { if (yych == 'c') goto yy685; goto yy523; } else { if (yych <= 'r') goto yy683; if (yych <= 's') goto yy684; goto yy523; } } yy674: yych = *++p; if (yych == 'M') goto yy682; if (yych == 'm') goto yy682; goto yy523; yy675: yych = *++p; if (yych <= 'P') { if (yych == 'E') goto yy679; if (yych <= 'O') goto yy523; goto yy680; } else { if (yych <= 'e') { if (yych <= 'd') goto yy523; goto yy679; } else { if (yych == 'p') goto yy680; goto yy523; } } yy676: yych = *++p; if (yych == 'T') goto yy677; if (yych != 't') goto yy523; yy677: yych = *++p; if (yych == 'T') goto yy678; if (yych != 't') goto yy523; yy678: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy679: yych = *++p; if (yych == 'V') goto yy681; if (yych == 'v') goto yy681; goto yy523; yy680: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy681: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy682: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy683: yych = *++p; if (yych == 'V') goto yy695; if (yych == 'v') goto yy695; goto yy523; yy684: yych = *++p; if (yych == 'S') goto yy692; if (yych == 's') goto yy692; goto yy523; yy685: yych = *++p; if (yych == 'O') goto yy686; if (yych != 'o') goto yy523; yy686: yych = *++p; if (yych == 'N') goto yy687; if (yych != 'n') goto yy523; yy687: yych = *++p; if (yych == 'D') goto yy688; if (yych != 'd') goto yy523; yy688: yych = *++p; if (yych == 'L') goto yy689; if (yych != 'l') goto yy523; yy689: yych = *++p; if (yych == 'I') goto yy690; if (yych != 'i') goto yy523; yy690: yych = *++p; if (yych == 'F') goto yy691; if (yych != 'f') goto yy523; yy691: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy692: yych = *++p; if (yych == 'I') goto yy693; if (yych != 'i') goto yy523; yy693: yych = *++p; if (yych == 'O') goto yy694; if (yych != 'o') goto yy523; yy694: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy695: yych = *++p; if (yych == 'I') goto yy696; if (yych != 'i') goto yy523; yy696: yych = *++p; if (yych == 'C') goto yy697; if (yych != 'c') goto yy523; yy697: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy698: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy699: yych = *++p; if (yych == 'P') goto yy700; if (yych != 'p') goto yy523; yy700: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy701: yych = *++p; if (yych == 'P') goto yy705; if (yych == 'p') goto yy705; goto yy523; yy702: yych = *++p; if (yych == 'D') goto yy703; if (yych != 'd') goto yy523; yy703: yych = *++p; if (yych == 'A') goto yy704; if (yych != 'a') goto yy523; yy704: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy705: yych = *++p; if (yych != '.') goto yy523; yych = *++p; if (yych == 'B') goto yy707; if (yych != 'b') goto yy523; yy707: yych = *++p; if (yych == 'E') goto yy708; if (yych != 'e') goto yy523; yy708: yych = *++p; if (yych == 'E') goto yy709; if (yych != 'e') goto yy523; yy709: yych = *++p; if (yych == 'P') goto yy710; if (yych != 'p') goto yy523; yy710: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy711: yych = *++p; if (yych == 'T') goto yy712; if (yych != 't') goto yy523; yy712: yych = *++p; if (yych == 'I') goto yy713; if (yych != 'i') goto yy523; yy713: yych = *++p; if (yych == 'F') goto yy714; if (yych != 'f') goto yy523; yy714: yych = *++p; if (yych == 'Y') goto yy533; if (yych == 'y') goto yy533; goto yy523; yy715: yych = *++p; if (yych == 'A') goto yy716; if (yych != 'a') goto yy523; yy716: yych = *++p; if (yych == 'M') goto yy533; if (yych == 'm') goto yy533; goto yy523; yy717: yych = *++p; if (yych <= 'S') { if (yych == 'M') goto yy729; if (yych <= 'R') goto yy523; goto yy728; } else { if (yych <= 'm') { if (yych <= 'l') goto yy523; goto yy729; } else { if (yych == 's') goto yy728; goto yy523; } } yy718: yych = *++p; if (yych == 'Y') goto yy726; if (yych == 'y') goto yy726; goto yy523; yy719: yych = *++p; if (yych == 'I') goto yy533; if (yych == 'i') goto yy533; goto yy523; yy720: yych = *++p; if (yych == 'S') goto yy721; if (yych != 's') goto yy523; yy721: yych = *++p; if (yych <= 'N') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'O') goto yy722; if (yych != 'o') goto yy523; } yy722: yych = *++p; if (yych == 'U') goto yy723; if (yych != 'u') goto yy523; yy723: yych = *++p; if (yych == 'R') goto yy724; if (yych != 'r') goto yy523; yy724: yych = *++p; if (yych == 'C') goto yy725; if (yych != 'c') goto yy523; yy725: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy726: yych = *++p; if (yych == 'N') goto yy727; if (yych != 'n') goto yy523; yy727: yych = *++p; if (yych == 'C') goto yy533; if (yych == 'c') goto yy533; goto yy523; yy728: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy729: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy730: yych = *++p; if (yych == 'Y') goto yy750; if (yych == 'y') goto yy750; goto yy523; yy731: yych = *++p; if (yych <= 'O') { if (yych == 'E') goto yy747; if (yych <= 'N') goto yy523; goto yy748; } else { if (yych <= 'e') { if (yych <= 'd') goto yy523; goto yy747; } else { if (yych == 'o') goto yy748; goto yy523; } } yy732: yych = *++p; if (yych == 'A') goto yy742; if (yych == 'a') goto yy742; goto yy523; yy733: yych = *++p; if (yych <= 'P') { if (yych == 'L') goto yy735; if (yych <= 'O') goto yy523; goto yy736; } else { if (yych <= 'l') { if (yych <= 'k') goto yy523; goto yy735; } else { if (yych == 'p') goto yy736; goto yy523; } } yy734: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy735: yych = *++p; if (yych == 'M') goto yy533; if (yych == 'm') goto yy533; goto yy523; yy736: yych = *++p; if (yych == 'A') goto yy737; if (yych != 'a') goto yy523; yy737: yych = *++p; if (yych == 'R') goto yy738; if (yych != 'r') goto yy523; yy738: yych = *++p; if (yych == 'A') goto yy739; if (yych != 'a') goto yy523; yy739: yych = *++p; if (yych == 'Z') goto yy740; if (yych != 'z') goto yy523; yy740: yych = *++p; if (yych == 'Z') goto yy741; if (yych != 'z') goto yy523; yy741: yych = *++p; if (yych == 'I') goto yy533; if (yych == 'i') goto yy533; goto yy523; yy742: yych = *++p; if (yych == 'T') goto yy743; if (yych != 't') goto yy523; yy743: yych = *++p; if (yych == 'F') goto yy744; if (yych != 'f') goto yy523; yy744: yych = *++p; if (yych == 'O') goto yy745; if (yych != 'o') goto yy523; yy745: yych = *++p; if (yych == 'R') goto yy746; if (yych != 'r') goto yy523; yy746: yych = *++p; if (yych == 'M') goto yy533; if (yych == 'm') goto yy533; goto yy523; yy747: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy748: yych = *++p; if (yych == 'X') goto yy749; if (yych != 'x') goto yy523; yy749: yych = *++p; if (yych == 'Y') goto yy533; if (yych == 'y') goto yy533; goto yy523; yy750: yych = *++p; if (yych == 'C') goto yy533; if (yych == 'c') goto yy533; goto yy523; yy751: yych = *++p; if (yych == 'D') goto yy533; if (yych == 'd') goto yy533; goto yy523; yy752: yych = *++p; if (yych == 'A') goto yy753; if (yych != 'a') goto yy523; yy753: yych = *++p; if (yych == 'Q') goto yy754; if (yych != 'q') goto yy523; yy754: yych = *++p; if (yych == 'U') goto yy755; if (yych != 'u') goto yy523; yy755: yych = *++p; if (yych == 'E') goto yy756; if (yych != 'e') goto yy523; yy756: yych = *++p; if (yych == 'L') goto yy757; if (yych != 'l') goto yy523; yy757: yych = *++p; if (yych == 'O') goto yy758; if (yych != 'o') goto yy523; yy758: yych = *++p; if (yych == 'C') goto yy759; if (yych != 'c') goto yy523; yy759: yych = *++p; if (yych == 'K') goto yy760; if (yych != 'k') goto yy523; yy760: yych = *++p; if (yych == 'T') goto yy761; if (yych != 't') goto yy523; yy761: yych = *++p; if (yych == 'O') goto yy762; if (yych != 'o') goto yy523; yy762: yych = *++p; if (yych == 'K') goto yy763; if (yych != 'k') goto yy523; yy763: yych = *++p; if (yych == 'E') goto yy764; if (yych != 'e') goto yy523; yy764: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy765: yych = *++p; if (yych == 'T') goto yy772; if (yych == 't') goto yy772; goto yy523; yy766: yych = *++p; if (yych == 'T') goto yy771; if (yych == 't') goto yy771; goto yy523; yy767: yych = *++p; if (yych <= 'G') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'H') goto yy533; if (yych == 'h') goto yy533; goto yy523; } yy768: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy769: yych = *++p; if (yych == 'W') goto yy770; if (yych != 'w') goto yy523; yy770: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy771: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy772: yych = *++p; if (yych == 'E') goto yy773; if (yych != 'e') goto yy523; yy773: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy774: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy775: yych = *++p; if (yych <= 'P') { if (yych == 'M') goto yy806; if (yych <= 'O') goto yy523; goto yy805; } else { if (yych <= 'm') { if (yych <= 'l') goto yy523; goto yy806; } else { if (yych == 'p') goto yy805; goto yy523; } } yy776: yych = *++p; if (yych <= 'Q') { if (yych <= '-') { if (yych <= ',') goto yy523; goto yy798; } else { if (yych == 'N') goto yy799; goto yy523; } } else { if (yych <= 'n') { if (yych <= 'R') goto yy797; if (yych <= 'm') goto yy523; goto yy799; } else { if (yych == 'r') goto yy797; goto yy523; } } yy777: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy778: yych = *++p; if (yych == 'S') goto yy793; if (yych == 's') goto yy793; goto yy523; yy779: yych = *++p; switch (yych) { case 'G': case 'g': goto yy784; case 'I': case 'i': goto yy783; case 'P': case 'p': goto yy785; case 'R': case 'r': goto yy786; default: goto yy523; } yy780: yych = *++p; if (yych == 'Q') goto yy782; if (yych == 'q') goto yy782; goto yy523; yy781: yych = *++p; if (yych == 'D') goto yy533; if (yych == 'd') goto yy533; goto yy523; yy782: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy783: yych = *++p; if (yych == 'L') goto yy791; if (yych == 'l') goto yy791; goto yy523; yy784: yych = *++p; if (yych == 'N') goto yy789; if (yych == 'n') goto yy789; goto yy523; yy785: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy786: yych = *++p; if (yych == 'K') goto yy787; if (yych != 'k') goto yy523; yy787: yych = *++p; if (yych == 'E') goto yy788; if (yych != 'e') goto yy523; yy788: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy789: yych = *++p; if (yych == 'E') goto yy790; if (yych != 'e') goto yy523; yy790: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy791: yych = *++p; if (yych == 'T') goto yy792; if (yych != 't') goto yy523; yy792: yych = *++p; if (yych == 'O') goto yy533; if (yych == 'o') goto yy533; goto yy523; yy793: yych = *++p; if (yych == 'S') goto yy794; if (yych != 's') goto yy523; yy794: yych = *++p; if (yych == 'A') goto yy795; if (yych != 'a') goto yy523; yy795: yych = *++p; if (yych == 'G') goto yy796; if (yych != 'g') goto yy523; yy796: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy797: yych = *++p; if (yych == 'P') goto yy804; if (yych == 'p') goto yy804; goto yy523; yy798: yych = *++p; if (yych == 'H') goto yy801; if (yych == 'h') goto yy801; goto yy523; yy799: yych = *++p; if (yych == 'I') goto yy800; if (yych != 'i') goto yy523; yy800: yych = *++p; if (yych == 'M') goto yy533; if (yych == 'm') goto yy533; goto yy523; yy801: yych = *++p; if (yych == 'E') goto yy802; if (yych != 'e') goto yy523; yy802: yych = *++p; if (yych == 'L') goto yy803; if (yych != 'l') goto yy523; yy803: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy804: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy805: yych = *++p; if (yych == 'D') goto yy809; if (yych == 'd') goto yy809; goto yy523; yy806: yych = *++p; if (yych == 'B') goto yy807; if (yych != 'b') goto yy523; yy807: yych = *++p; if (yych == 'L') goto yy808; if (yych != 'l') goto yy523; yy808: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy809: yych = *++p; if (yych == 'A') goto yy810; if (yych != 'a') goto yy523; yy810: yych = *++p; if (yych == 'T') goto yy811; if (yych != 't') goto yy523; yy811: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy812: yych = *++p; if (yych == 'A') goto yy817; if (yych == 'a') goto yy817; goto yy523; yy813: yych = *++p; if (yych == 'S') goto yy814; if (yych != 's') goto yy523; yy814: yych = *++p; if (yych == 'T') goto yy815; if (yych != 't') goto yy523; yy815: yych = *++p; if (yych == 'F') goto yy816; if (yych != 'f') goto yy523; yy816: yych = *++p; if (yych == 'M') goto yy533; if (yych == 'm') goto yy533; goto yy523; yy817: yych = *++p; if (yych == 'P') goto yy818; if (yych != 'p') goto yy523; yy818: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy819: yych = *++p; if (yych == 'M') goto yy842; if (yych == 'm') goto yy842; goto yy523; yy820: yych = *++p; if (yych <= 'I') { if (yych == 'C') goto yy831; if (yych <= 'H') goto yy523; goto yy830; } else { if (yych <= 'c') { if (yych <= 'b') goto yy523; goto yy831; } else { if (yych == 'i') goto yy830; goto yy523; } } yy821: yych = *++p; if (yych <= 'P') { if (yych == 'N') goto yy533; if (yych <= 'O') goto yy523; goto yy533; } else { if (yych <= 'n') { if (yych <= 'm') goto yy523; goto yy533; } else { if (yych == 'p') goto yy533; goto yy523; } } yy822: yych = *++p; if (yych <= 'O') { if (yych == 'A') goto yy828; if (yych <= 'N') goto yy523; goto yy829; } else { if (yych <= 'a') { if (yych <= '`') goto yy523; goto yy828; } else { if (yych == 'o') goto yy829; goto yy523; } } yy823: yych = *++p; if (yych == 'F') goto yy827; if (yych == 'f') goto yy827; goto yy523; yy824: yych = *++p; if (yych <= '@') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'A') goto yy826; if (yych == 'a') goto yy826; goto yy523; } yy825: yych = *++p; if (yych == 'X') goto yy533; if (yych == 'x') goto yy533; goto yy523; yy826: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy827: yych = *++p; if (yych == 'O') goto yy533; if (yych == 'o') goto yy533; goto yy523; yy828: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy829: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy830: yych = *++p; if (yych == 'S') goto yy832; if (yych == 's') goto yy832; goto yy523; yy831: yych = *++p; if (yych <= ':') { if (yych == '6') goto yy533; if (yych <= '9') goto yy523; goto yy534; } else { if (yych <= 'S') { if (yych <= 'R') goto yy523; goto yy533; } else { if (yych == 's') goto yy533; goto yy523; } } yy832: yych = *++p; if (yych == '.') goto yy833; if (yych == ':') goto yy534; goto yy523; yy833: yych = *++p; if (yych <= 'X') { if (yych <= 'K') { if (yych == 'B') goto yy836; goto yy523; } else { if (yych <= 'L') goto yy834; if (yych <= 'W') goto yy523; goto yy835; } } else { if (yych <= 'k') { if (yych == 'b') goto yy836; goto yy523; } else { if (yych <= 'l') goto yy834; if (yych == 'x') goto yy835; goto yy523; } } yy834: yych = *++p; if (yych == 'W') goto yy841; if (yych == 'w') goto yy841; goto yy523; yy835: yych = *++p; if (yych == 'P') goto yy839; if (yych == 'p') goto yy839; goto yy523; yy836: yych = *++p; if (yych == 'E') goto yy837; if (yych != 'e') goto yy523; yy837: yych = *++p; if (yych == 'E') goto yy838; if (yych != 'e') goto yy523; yy838: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy839: yych = *++p; if (yych == 'C') goto yy840; if (yych != 'c') goto yy523; yy840: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy841: yych = *++p; if (yych == 'Z') goto yy533; if (yych == 'z') goto yy533; goto yy523; yy842: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy843: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy844: yych = *++p; if (yych == 'T') goto yy847; if (yych == 't') goto yy847; goto yy523; yy845: yych = *++p; if (yych != '2') goto yy523; yych = *++p; if (yych == '3') goto yy533; goto yy523; yy847: yych = *++p; if (yych == 'P') goto yy848; if (yych != 'p') goto yy523; yy848: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy849: yych = *++p; if (yych == 'A') goto yy865; if (yych == 'a') goto yy865; goto yy523; yy850: yych = *++p; if (yych <= 'Z') { if (yych == 'T') goto yy533; if (yych <= 'Y') goto yy523; goto yy856; } else { if (yych <= 't') { if (yych <= 's') goto yy523; goto yy533; } else { if (yych == 'z') goto yy856; goto yy523; } } yy851: yych = *++p; if (yych <= 'O') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'P') goto yy853; if (yych == 'p') goto yy853; goto yy523; } yy852: yych = *++p; if (yych == 'O') goto yy533; if (yych == 'o') goto yy533; goto yy523; yy853: yych = *++p; if (yych == 'H') goto yy854; if (yych != 'h') goto yy523; yy854: yych = *++p; if (yych == 'E') goto yy855; if (yych != 'e') goto yy523; yy855: yych = *++p; if (yych == 'R') goto yy533; if (yych == 'r') goto yy533; goto yy523; yy856: yych = *++p; if (yych == 'M') goto yy857; if (yych != 'm') goto yy523; yy857: yych = *++p; if (yych == 'O') goto yy858; if (yych != 'o') goto yy523; yy858: yych = *++p; if (yych == 'P') goto yy859; if (yych != 'p') goto yy523; yy859: yych = *++p; if (yych == 'R') goto yy860; if (yych != 'r') goto yy523; yy860: yych = *++p; if (yych == 'O') goto yy861; if (yych != 'o') goto yy523; yy861: yych = *++p; if (yych == 'J') goto yy862; if (yych != 'j') goto yy523; yy862: yych = *++p; if (yych == 'E') goto yy863; if (yych != 'e') goto yy523; yy863: yych = *++p; if (yych == 'C') goto yy864; if (yych != 'c') goto yy523; yy864: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy865: yych = *++p; if (yych == 'L') goto yy866; if (yych != 'l') goto yy523; yy866: yych = *++p; if (yych == 'K') goto yy533; if (yych == 'k') goto yy533; goto yy523; yy867: yych = *++p; if (yych <= 'S') { if (yych <= 'M') { if (yych == 'L') goto yy877; goto yy523; } else { if (yych <= 'N') goto yy878; if (yych <= 'R') goto yy523; goto yy879; } } else { if (yych <= 'm') { if (yych == 'l') goto yy877; goto yy523; } else { if (yych <= 'n') goto yy878; if (yych == 's') goto yy879; goto yy523; } } yy868: yych = *++p; if (yych == 'E') goto yy876; if (yych == 'e') goto yy876; goto yy523; yy869: yych = *++p; if (yych == 'C') goto yy871; if (yych == 'c') goto yy871; goto yy523; yy870: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy871: yych = *++p; if (yych == 'E') goto yy872; if (yych != 'e') goto yy523; yy872: yych = *++p; if (yych == 'T') goto yy873; if (yych != 't') goto yy523; yy873: yych = *++p; if (yych == 'I') goto yy874; if (yych != 'i') goto yy523; yy874: yych = *++p; if (yych == 'M') goto yy875; if (yych != 'm') goto yy523; yy875: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy876: yych = *++p; if (yych == 'D') goto yy533; if (yych == 'd') goto yy533; goto yy523; yy877: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy878: yych = *++p; if (yych == 'G') goto yy880; if (yych == 'g') goto yy880; goto yy523; yy879: yych = *++p; if (yych == 'H') goto yy533; if (yych == 'h') goto yy533; goto yy523; yy880: yych = *++p; if (yych == 'E') goto yy881; if (yych != 'e') goto yy523; yy881: yych = *++p; if (yych == 'R') goto yy533; if (yych == 'r') goto yy533; goto yy523; yy882: yych = *++p; if (yych == 'T') goto yy900; if (yych == 't') goto yy900; goto yy523; yy883: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy884: yych = *++p; if (yych == 'M') goto yy533; if (yych == 'm') goto yy533; goto yy523; yy885: yych = *++p; if (yych <= 'S') { if (yych == 'P') goto yy533; if (yych <= 'R') goto yy523; goto yy533; } else { if (yych <= 'p') { if (yych <= 'o') goto yy523; goto yy533; } else { if (yych == 's') goto yy533; goto yy523; } } yy886: yych = *++p; if (yych == 'I') goto yy894; if (yych == 'i') goto yy894; goto yy523; yy887: yych = *++p; if (yych == 'A') goto yy893; if (yych == 'a') goto yy893; goto yy523; yy888: yych = *++p; if (yych == 'O') goto yy891; if (yych == 'o') goto yy891; goto yy523; yy889: yych = *++p; if (yych == 'A') goto yy890; if (yych != 'a') goto yy523; yy890: yych = *++p; if (yych <= 'R') { if (yych == ':') goto yy534; goto yy523; } else { if (yych <= 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; } yy891: yych = *++p; if (yych == 'U') goto yy892; if (yych != 'u') goto yy523; yy892: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy893: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy894: yych = *++p; if (yych == 'U') goto yy895; if (yych != 'u') goto yy523; yy895: yych = *++p; if (yych == 'M') goto yy896; if (yych != 'm') goto yy523; yy896: yych = *++p; if (yych == 'X') goto yy897; if (yych != 'x') goto yy523; yy897: yych = *++p; if (yych == 'T') goto yy898; if (yych != 't') goto yy523; yy898: yych = *++p; if (yych == 'R') goto yy899; if (yych != 'r') goto yy523; yy899: yych = *++p; if (yych == 'A') goto yy533; if (yych == 'a') goto yy533; goto yy523; yy900: yych = *++p; if (yych == 'A') goto yy901; if (yych != 'a') goto yy523; yy901: yych = *++p; if (yych == 'C') goto yy902; if (yych != 'c') goto yy523; yy902: yych = *++p; if (yych == 'H') goto yy903; if (yych != 'h') goto yy523; yy903: yych = *++p; if (yych == 'M') goto yy904; if (yych != 'm') goto yy523; yy904: yych = *++p; if (yych == 'E') goto yy905; if (yych != 'e') goto yy523; yy905: yych = *++p; if (yych == 'N') goto yy906; if (yych != 'n') goto yy523; yy906: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy907: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy908: yych = *++p; if (yych <= 'V') { if (yych == 'R') goto yy533; if (yych <= 'U') goto yy523; } else { if (yych <= 'r') { if (yych <= 'q') goto yy523; goto yy533; } else { if (yych != 'v') goto yy523; } } yych = *++p; if (yych == 'A') goto yy910; if (yych != 'a') goto yy523; yy910: yych = *++p; if (yych == 'S') goto yy911; if (yych != 's') goto yy523; yy911: yych = *++p; if (yych == 'C') goto yy912; if (yych != 'c') goto yy523; yy912: yych = *++p; if (yych == 'R') goto yy913; if (yych != 'r') goto yy523; yy913: yych = *++p; if (yych == 'I') goto yy914; if (yych != 'i') goto yy523; yy914: yych = *++p; if (yych == 'P') goto yy915; if (yych != 'p') goto yy523; yy915: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy916: yych = *++p; if (yych == 'B') goto yy533; if (yych == 'b') goto yy533; goto yy523; yy917: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy918: yych = *++p; if (yych == 'N') goto yy925; if (yych == 'n') goto yy925; goto yy523; yy919: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy920: yych = *++p; if (yych == 'C') goto yy924; if (yych == 'c') goto yy924; goto yy523; yy921: yych = *++p; if (yych <= 'V') { if (yych == 'T') goto yy923; if (yych <= 'U') goto yy523; goto yy533; } else { if (yych <= 't') { if (yych <= 's') goto yy523; goto yy923; } else { if (yych == 'v') goto yy533; goto yy523; } } yy922: yych = *++p; if (yych == 'I') goto yy533; if (yych == 'i') goto yy533; goto yy523; yy923: yych = *++p; if (yych == 'A') goto yy533; if (yych == 'a') goto yy533; goto yy523; yy924: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy925: yych = *++p; if (yych == 'A') goto yy926; if (yych != 'a') goto yy523; yy926: yych = *++p; if (yych != '-') goto yy523; yych = *++p; if (yych == 'P') goto yy928; if (yych != 'p') goto yy523; yy928: yych = *++p; if (yych == 'L') goto yy929; if (yych != 'l') goto yy523; yy929: yych = *++p; if (yych == 'A') goto yy930; if (yych != 'a') goto yy523; yy930: yych = *++p; if (yych == 'Y') goto yy931; if (yych != 'y') goto yy523; yy931: yych = *++p; if (yych <= 'S') { if (yych == 'C') goto yy932; if (yych <= 'R') goto yy523; goto yy933; } else { if (yych <= 'c') { if (yych <= 'b') goto yy523; } else { if (yych == 's') goto yy933; goto yy523; } } yy932: yych = *++p; if (yych == 'O') goto yy938; if (yych == 'o') goto yy938; goto yy523; yy933: yych = *++p; if (yych == 'I') goto yy934; if (yych != 'i') goto yy523; yy934: yych = *++p; if (yych == 'N') goto yy935; if (yych != 'n') goto yy523; yy935: yych = *++p; if (yych == 'G') goto yy936; if (yych != 'g') goto yy523; yy936: yych = *++p; if (yych == 'L') goto yy937; if (yych != 'l') goto yy523; yy937: yych = *++p; if (yych == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; yy938: yych = *++p; if (yych == 'N') goto yy939; if (yych != 'n') goto yy523; yy939: yych = *++p; if (yych == 'T') goto yy940; if (yych != 't') goto yy523; yy940: yych = *++p; if (yych == 'A') goto yy941; if (yych != 'a') goto yy523; yy941: yych = *++p; if (yych == 'I') goto yy942; if (yych != 'i') goto yy523; yy942: yych = *++p; if (yych == 'N') goto yy943; if (yych != 'n') goto yy523; yy943: yych = *++p; if (yych == 'E') goto yy944; if (yych != 'e') goto yy523; yy944: yych = *++p; if (yych == 'R') goto yy533; if (yych == 'r') goto yy533; goto yy523; yy945: yych = *++p; if (yych == 'S') goto yy533; if (yych == 's') goto yy533; goto yy523; yy946: yych = *++p; if (yych <= 'N') { if (yych <= 'A') { if (yych <= '@') goto yy523; goto yy968; } else { if (yych <= 'L') goto yy523; if (yych <= 'M') goto yy969; goto yy970; } } else { if (yych <= 'l') { if (yych == 'a') goto yy968; goto yy523; } else { if (yych <= 'm') goto yy969; if (yych <= 'n') goto yy970; goto yy523; } } yy947: yych = *++p; if (yych == 'R') goto yy955; if (yych == 'r') goto yy955; goto yy523; yy948: yych = *++p; if (yych <= 'P') { if (yych == 'L') goto yy952; if (yych <= 'O') goto yy523; goto yy533; } else { if (yych <= 'l') { if (yych <= 'k') goto yy523; goto yy952; } else { if (yych == 'p') goto yy533; goto yy523; } } yy949: yych = *++p; if (yych == 'I') goto yy951; if (yych == 'i') goto yy951; goto yy523; yy950: yych = *++p; if (yych == 'D') goto yy533; if (yych == 'd') goto yy533; goto yy523; yy951: yych = *++p; if (yych == 'D') goto yy533; if (yych == 'd') goto yy533; goto yy523; yy952: yych = *++p; if (yych == 'L') goto yy953; if (yych != 'l') goto yy523; yy953: yych = *++p; if (yych == 'T') goto yy954; if (yych != 't') goto yy523; yy954: yych = *++p; if (yych == 'O') goto yy533; if (yych == 'o') goto yy533; goto yy523; yy955: yych = *++p; if (yych == 'O') goto yy956; if (yych != 'o') goto yy523; yy956: yych = *++p; if (yych == 'M') goto yy957; if (yych != 'm') goto yy523; yy957: yych = *++p; if (yych == 'E') goto yy958; if (yych != 'e') goto yy523; yy958: yych = *++p; if (yych == '-') goto yy959; if (yych == ':') goto yy534; goto yy523; yy959: yych = *++p; if (yych == 'E') goto yy960; if (yych != 'e') goto yy523; yy960: yych = *++p; if (yych == 'X') goto yy961; if (yych != 'x') goto yy523; yy961: yych = *++p; if (yych == 'T') goto yy962; if (yych != 't') goto yy523; yy962: yych = *++p; if (yych == 'E') goto yy963; if (yych != 'e') goto yy523; yy963: yych = *++p; if (yych == 'N') goto yy964; if (yych != 'n') goto yy523; yy964: yych = *++p; if (yych == 'S') goto yy965; if (yych != 's') goto yy523; yy965: yych = *++p; if (yych == 'I') goto yy966; if (yych != 'i') goto yy523; yy966: yych = *++p; if (yych == 'O') goto yy967; if (yych != 'o') goto yy523; yy967: yych = *++p; if (yych == 'N') goto yy533; if (yych == 'n') goto yy533; goto yy523; yy968: yych = *++p; if (yych == 'P') goto yy533; if (yych == 'p') goto yy533; goto yy523; yy969: yych = *++p; if (yych == '-') goto yy974; goto yy523; yy970: yych = *++p; if (yych == 'T') goto yy971; if (yych != 't') goto yy523; yy971: yych = *++p; if (yych == 'E') goto yy972; if (yych != 'e') goto yy523; yy972: yych = *++p; if (yych == 'N') goto yy973; if (yych != 'n') goto yy523; yy973: yych = *++p; if (yych == 'T') goto yy533; if (yych == 't') goto yy533; goto yy523; yy974: yych = *++p; if (yych == 'E') goto yy975; if (yych != 'e') goto yy523; yy975: yych = *++p; if (yych == 'V') goto yy976; if (yych != 'v') goto yy523; yy976: yych = *++p; if (yych == 'E') goto yy977; if (yych != 'e') goto yy523; yy977: yych = *++p; if (yych == 'N') goto yy978; if (yych != 'n') goto yy523; yy978: yych = *++p; if (yych == 'T') goto yy979; if (yych != 't') goto yy523; yy979: yych = *++p; if (yych == 'B') goto yy980; if (yych != 'b') goto yy523; yy980: yych = *++p; if (yych == 'R') goto yy981; if (yych != 'r') goto yy523; yy981: yych = *++p; if (yych == 'I') goto yy982; if (yych != 'i') goto yy523; yy982: yych = *++p; if (yych == 'T') goto yy983; if (yych != 't') goto yy523; yy983: yych = *++p; if (yych == 'E') goto yy984; if (yych != 'e') goto yy523; yy984: yych = *++p; if (yych != '-') goto yy523; yych = *++p; if (yych == 'A') goto yy986; if (yych != 'a') goto yy523; yy986: yych = *++p; if (yych == 'T') goto yy987; if (yych != 't') goto yy523; yy987: yych = *++p; if (yych == 'T') goto yy988; if (yych != 't') goto yy523; yy988: yych = *++p; if (yych == 'E') goto yy989; if (yych != 'e') goto yy523; yy989: yych = *++p; if (yych == 'N') goto yy990; if (yych != 'n') goto yy523; yy990: yych = *++p; if (yych == 'D') goto yy991; if (yych != 'd') goto yy523; yy991: yych = *++p; if (yych == 'E') goto yy992; if (yych != 'e') goto yy523; yy992: ++p; if ((yych = *p) == 'E') goto yy533; if (yych == 'e') goto yy533; goto yy523; } } // Try to match email autolink after first <, returning num of chars matched. bufsize_t _scan_autolink_email(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 128, 128, 128, 128, 128, 0, 0, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 128, 0, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= '?') { if (yych <= ')') { if (yych <= ' ') { if (yych != '\n') goto yy997; } else { if (yych == '"') goto yy997; if (yych <= '\'') goto yy996; goto yy997; } } else { if (yych <= '9') { if (yych == ',') goto yy997; goto yy996; } else { if (yych == '=') goto yy996; if (yych <= '>') goto yy997; goto yy996; } } } else { if (yych <= 0xDF) { if (yych <= ']') { if (yych <= '@') goto yy997; if (yych <= 'Z') goto yy996; goto yy997; } else { if (yych <= '~') goto yy996; if (yych <= 0x7F) goto yy997; if (yych >= 0xC2) goto yy998; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1000; if (yych == 0xED) goto yy1005; goto yy1001; } else { if (yych <= 0xF0) goto yy1002; if (yych <= 0xF3) goto yy1003; if (yych <= 0xF4) goto yy1004; } } } yy995 : { return 0; } yy996: yych = *(marker = ++p); if (yych <= ',') { if (yych <= '"') { if (yych == '!') goto yy1008; goto yy995; } else { if (yych <= '\'') goto yy1008; if (yych <= ')') goto yy995; if (yych <= '+') goto yy1008; goto yy995; } } else { if (yych <= '>') { if (yych <= '9') goto yy1008; if (yych == '=') goto yy1008; goto yy995; } else { if (yych <= 'Z') goto yy1008; if (yych <= ']') goto yy995; if (yych <= '~') goto yy1008; goto yy995; } } yy997: yych = *++p; goto yy995; yy998: yych = *++p; if (yych <= 0x7F) goto yy999; if (yych <= 0xBF) goto yy997; yy999: p = marker; goto yy995; yy1000: yych = *++p; if (yych <= 0x9F) goto yy999; if (yych <= 0xBF) goto yy998; goto yy999; yy1001: yych = *++p; if (yych <= 0x7F) goto yy999; if (yych <= 0xBF) goto yy998; goto yy999; yy1002: yych = *++p; if (yych <= 0x8F) goto yy999; if (yych <= 0xBF) goto yy1001; goto yy999; yy1003: yych = *++p; if (yych <= 0x7F) goto yy999; if (yych <= 0xBF) goto yy1001; goto yy999; yy1004: yych = *++p; if (yych <= 0x7F) goto yy999; if (yych <= 0x8F) goto yy1001; goto yy999; yy1005: yych = *++p; if (yych <= 0x7F) goto yy999; if (yych <= 0x9F) goto yy998; goto yy999; yy1006: yych = *++p; if (yych <= '@') { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1009; goto yy999; } else { if (yych <= 'Z') goto yy1009; if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1009; goto yy999; } yy1007: ++p; yych = *p; yy1008: if (yybm[0 + yych] & 128) { goto yy1007; } if (yych <= '>') goto yy999; if (yych <= '@') goto yy1006; goto yy999; yy1009: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1011; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1011; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1011; goto yy999; } } yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1139; if (yych <= '/') goto yy999; goto yy1140; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1140; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1140; goto yy999; } } yy1011: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych <= '-') goto yy1139; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1140; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1140; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1140; goto yy999; } } yy1012: ++p; yych = *p; if (yych <= '@') { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1015; goto yy999; } else { if (yych <= 'Z') goto yy1015; if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1015; goto yy999; } yy1013: ++p; { return (bufsize_t)(p - start); } yy1015: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1017; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1017; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1017; goto yy999; } } ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1018; if (yych <= '/') goto yy999; goto yy1019; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1019; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1019; goto yy999; } } yy1017: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1019; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1019; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1019; goto yy999; } } yy1018: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1020; if (yych <= '/') goto yy999; goto yy1021; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1021; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1021; goto yy999; } } yy1019: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1021; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1021; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1021; goto yy999; } } yy1020: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1022; if (yych <= '/') goto yy999; goto yy1023; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1023; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1023; goto yy999; } } yy1021: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1023; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1023; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1023; goto yy999; } } yy1022: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1024; if (yych <= '/') goto yy999; goto yy1025; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1025; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1025; goto yy999; } } yy1023: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1025; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1025; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1025; goto yy999; } } yy1024: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1026; if (yych <= '/') goto yy999; goto yy1027; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1027; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1027; goto yy999; } } yy1025: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1027; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1027; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1027; goto yy999; } } yy1026: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1028; if (yych <= '/') goto yy999; goto yy1029; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1029; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1029; goto yy999; } } yy1027: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1029; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1029; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1029; goto yy999; } } yy1028: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1030; if (yych <= '/') goto yy999; goto yy1031; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1031; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1031; goto yy999; } } yy1029: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1031; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1031; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1031; goto yy999; } } yy1030: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1032; if (yych <= '/') goto yy999; goto yy1033; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1033; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1033; goto yy999; } } yy1031: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1033; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1033; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1033; goto yy999; } } yy1032: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1034; if (yych <= '/') goto yy999; goto yy1035; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1035; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1035; goto yy999; } } yy1033: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1035; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1035; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1035; goto yy999; } } yy1034: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1036; if (yych <= '/') goto yy999; goto yy1037; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1037; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1037; goto yy999; } } yy1035: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1037; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1037; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1037; goto yy999; } } yy1036: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1038; if (yych <= '/') goto yy999; goto yy1039; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1039; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1039; goto yy999; } } yy1037: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1039; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1039; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1039; goto yy999; } } yy1038: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1040; if (yych <= '/') goto yy999; goto yy1041; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1041; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1041; goto yy999; } } yy1039: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1041; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1041; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1041; goto yy999; } } yy1040: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1042; if (yych <= '/') goto yy999; goto yy1043; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1043; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1043; goto yy999; } } yy1041: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1043; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1043; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1043; goto yy999; } } yy1042: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1044; if (yych <= '/') goto yy999; goto yy1045; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1045; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1045; goto yy999; } } yy1043: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1045; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1045; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1045; goto yy999; } } yy1044: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1046; if (yych <= '/') goto yy999; goto yy1047; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1047; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1047; goto yy999; } } yy1045: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1047; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1047; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1047; goto yy999; } } yy1046: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1048; if (yych <= '/') goto yy999; goto yy1049; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1049; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1049; goto yy999; } } yy1047: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1049; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1049; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1049; goto yy999; } } yy1048: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1050; if (yych <= '/') goto yy999; goto yy1051; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1051; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1051; goto yy999; } } yy1049: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1051; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1051; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1051; goto yy999; } } yy1050: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1052; if (yych <= '/') goto yy999; goto yy1053; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1053; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1053; goto yy999; } } yy1051: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1053; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1053; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1053; goto yy999; } } yy1052: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1054; if (yych <= '/') goto yy999; goto yy1055; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1055; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1055; goto yy999; } } yy1053: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1055; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1055; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1055; goto yy999; } } yy1054: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1056; if (yych <= '/') goto yy999; goto yy1057; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1057; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1057; goto yy999; } } yy1055: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1057; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1057; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1057; goto yy999; } } yy1056: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1058; if (yych <= '/') goto yy999; goto yy1059; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1059; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1059; goto yy999; } } yy1057: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1059; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1059; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1059; goto yy999; } } yy1058: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1060; if (yych <= '/') goto yy999; goto yy1061; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1061; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1061; goto yy999; } } yy1059: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1061; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1061; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1061; goto yy999; } } yy1060: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1062; if (yych <= '/') goto yy999; goto yy1063; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1063; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1063; goto yy999; } } yy1061: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1063; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1063; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1063; goto yy999; } } yy1062: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1064; if (yych <= '/') goto yy999; goto yy1065; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1065; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1065; goto yy999; } } yy1063: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1065; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1065; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1065; goto yy999; } } yy1064: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1066; if (yych <= '/') goto yy999; goto yy1067; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1067; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1067; goto yy999; } } yy1065: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1067; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1067; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1067; goto yy999; } } yy1066: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1068; if (yych <= '/') goto yy999; goto yy1069; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1069; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1069; goto yy999; } } yy1067: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1069; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1069; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1069; goto yy999; } } yy1068: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1070; if (yych <= '/') goto yy999; goto yy1071; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1071; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1071; goto yy999; } } yy1069: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1071; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1071; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1071; goto yy999; } } yy1070: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1072; if (yych <= '/') goto yy999; goto yy1073; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1073; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1073; goto yy999; } } yy1071: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1073; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1073; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1073; goto yy999; } } yy1072: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1074; if (yych <= '/') goto yy999; goto yy1075; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1075; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1075; goto yy999; } } yy1073: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1075; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1075; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1075; goto yy999; } } yy1074: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1076; if (yych <= '/') goto yy999; goto yy1077; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1077; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1077; goto yy999; } } yy1075: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1077; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1077; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1077; goto yy999; } } yy1076: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1078; if (yych <= '/') goto yy999; goto yy1079; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1079; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1079; goto yy999; } } yy1077: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1079; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1079; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1079; goto yy999; } } yy1078: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1080; if (yych <= '/') goto yy999; goto yy1081; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1081; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1081; goto yy999; } } yy1079: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1081; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1081; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1081; goto yy999; } } yy1080: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1082; if (yych <= '/') goto yy999; goto yy1083; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1083; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1083; goto yy999; } } yy1081: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1083; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1083; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1083; goto yy999; } } yy1082: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1084; if (yych <= '/') goto yy999; goto yy1085; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1085; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1085; goto yy999; } } yy1083: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1085; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1085; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1085; goto yy999; } } yy1084: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1086; if (yych <= '/') goto yy999; goto yy1087; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1087; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1087; goto yy999; } } yy1085: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1087; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1087; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1087; goto yy999; } } yy1086: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1088; if (yych <= '/') goto yy999; goto yy1089; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1089; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1089; goto yy999; } } yy1087: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1089; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1089; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1089; goto yy999; } } yy1088: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1090; if (yych <= '/') goto yy999; goto yy1091; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1091; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1091; goto yy999; } } yy1089: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1091; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1091; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1091; goto yy999; } } yy1090: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1092; if (yych <= '/') goto yy999; goto yy1093; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1093; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1093; goto yy999; } } yy1091: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1093; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1093; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1093; goto yy999; } } yy1092: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1094; if (yych <= '/') goto yy999; goto yy1095; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1095; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1095; goto yy999; } } yy1093: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1095; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1095; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1095; goto yy999; } } yy1094: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1096; if (yych <= '/') goto yy999; goto yy1097; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1097; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1097; goto yy999; } } yy1095: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1097; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1097; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1097; goto yy999; } } yy1096: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1098; if (yych <= '/') goto yy999; goto yy1099; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1099; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1099; goto yy999; } } yy1097: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1099; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1099; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1099; goto yy999; } } yy1098: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1100; if (yych <= '/') goto yy999; goto yy1101; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1101; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1101; goto yy999; } } yy1099: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1101; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1101; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1101; goto yy999; } } yy1100: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1102; if (yych <= '/') goto yy999; goto yy1103; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1103; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1103; goto yy999; } } yy1101: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1103; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1103; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1103; goto yy999; } } yy1102: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1104; if (yych <= '/') goto yy999; goto yy1105; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1105; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1105; goto yy999; } } yy1103: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1105; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1105; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1105; goto yy999; } } yy1104: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1106; if (yych <= '/') goto yy999; goto yy1107; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1107; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1107; goto yy999; } } yy1105: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1107; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1107; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1107; goto yy999; } } yy1106: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1108; if (yych <= '/') goto yy999; goto yy1109; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1109; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1109; goto yy999; } } yy1107: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1109; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1109; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1109; goto yy999; } } yy1108: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1110; if (yych <= '/') goto yy999; goto yy1111; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1111; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1111; goto yy999; } } yy1109: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1111; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1111; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1111; goto yy999; } } yy1110: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1112; if (yych <= '/') goto yy999; goto yy1113; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1113; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1113; goto yy999; } } yy1111: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1113; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1113; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1113; goto yy999; } } yy1112: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1114; if (yych <= '/') goto yy999; goto yy1115; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1115; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1115; goto yy999; } } yy1113: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1115; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1115; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1115; goto yy999; } } yy1114: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1116; if (yych <= '/') goto yy999; goto yy1117; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1117; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1117; goto yy999; } } yy1115: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1117; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1117; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1117; goto yy999; } } yy1116: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1118; if (yych <= '/') goto yy999; goto yy1119; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1119; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1119; goto yy999; } } yy1117: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1119; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1119; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1119; goto yy999; } } yy1118: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1120; if (yych <= '/') goto yy999; goto yy1121; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1121; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1121; goto yy999; } } yy1119: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1121; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1121; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1121; goto yy999; } } yy1120: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1122; if (yych <= '/') goto yy999; goto yy1123; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1123; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1123; goto yy999; } } yy1121: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1123; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1123; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1123; goto yy999; } } yy1122: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1124; if (yych <= '/') goto yy999; goto yy1125; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1125; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1125; goto yy999; } } yy1123: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1125; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1125; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1125; goto yy999; } } yy1124: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1126; if (yych <= '/') goto yy999; goto yy1127; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1127; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1127; goto yy999; } } yy1125: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1127; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1127; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1127; goto yy999; } } yy1126: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1128; if (yych <= '/') goto yy999; goto yy1129; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1129; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1129; goto yy999; } } yy1127: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1129; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1129; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1129; goto yy999; } } yy1128: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1130; if (yych <= '/') goto yy999; goto yy1131; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1131; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1131; goto yy999; } } yy1129: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1131; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1131; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1131; goto yy999; } } yy1130: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1132; if (yych <= '/') goto yy999; goto yy1133; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1133; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1133; goto yy999; } } yy1131: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1133; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1133; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1133; goto yy999; } } yy1132: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1134; if (yych <= '/') goto yy999; goto yy1135; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1135; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1135; goto yy999; } } yy1133: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1135; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1135; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1135; goto yy999; } } yy1134: ++p; yych = *p; if (yych <= '9') { if (yych == '-') goto yy1136; if (yych <= '/') goto yy999; goto yy1137; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1137; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1137; goto yy999; } } yy1135: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1137; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1137; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1137; goto yy999; } } yy1136: ++p; yych = *p; if (yych <= '@') { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1138; goto yy999; } else { if (yych <= 'Z') goto yy1138; if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1138; goto yy999; } yy1137: ++p; yych = *p; if (yych <= '=') { if (yych <= '.') { if (yych <= '-') goto yy999; goto yy1012; } else { if (yych <= '/') goto yy999; if (yych >= ':') goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; } else { if (yych <= '`') goto yy999; if (yych >= '{') goto yy999; } } yy1138: ++p; yych = *p; if (yych == '.') goto yy1012; if (yych == '>') goto yy1013; goto yy999; yy1139: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1141; if (yych <= '/') goto yy999; goto yy1142; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1142; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1142; goto yy999; } } yy1140: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1142; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1142; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1142; goto yy999; } } yy1141: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1143; if (yych <= '/') goto yy999; goto yy1144; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1144; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1144; goto yy999; } } yy1142: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1144; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1144; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1144; goto yy999; } } yy1143: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1145; if (yych <= '/') goto yy999; goto yy1146; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1146; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1146; goto yy999; } } yy1144: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1146; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1146; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1146; goto yy999; } } yy1145: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1147; if (yych <= '/') goto yy999; goto yy1148; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1148; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1148; goto yy999; } } yy1146: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1148; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1148; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1148; goto yy999; } } yy1147: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1149; if (yych <= '/') goto yy999; goto yy1150; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1150; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1150; goto yy999; } } yy1148: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1150; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1150; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1150; goto yy999; } } yy1149: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1151; if (yych <= '/') goto yy999; goto yy1152; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1152; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1152; goto yy999; } } yy1150: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1152; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1152; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1152; goto yy999; } } yy1151: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1153; if (yych <= '/') goto yy999; goto yy1154; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1154; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1154; goto yy999; } } yy1152: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1154; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1154; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1154; goto yy999; } } yy1153: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1155; if (yych <= '/') goto yy999; goto yy1156; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1156; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1156; goto yy999; } } yy1154: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1156; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1156; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1156; goto yy999; } } yy1155: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1157; if (yych <= '/') goto yy999; goto yy1158; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1158; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1158; goto yy999; } } yy1156: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1158; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1158; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1158; goto yy999; } } yy1157: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1159; if (yych <= '/') goto yy999; goto yy1160; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1160; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1160; goto yy999; } } yy1158: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1160; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1160; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1160; goto yy999; } } yy1159: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1161; if (yych <= '/') goto yy999; goto yy1162; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1162; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1162; goto yy999; } } yy1160: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1162; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1162; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1162; goto yy999; } } yy1161: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1163; if (yych <= '/') goto yy999; goto yy1164; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1164; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1164; goto yy999; } } yy1162: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1164; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1164; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1164; goto yy999; } } yy1163: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1165; if (yych <= '/') goto yy999; goto yy1166; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1166; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1166; goto yy999; } } yy1164: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1166; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1166; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1166; goto yy999; } } yy1165: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1167; if (yych <= '/') goto yy999; goto yy1168; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1168; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1168; goto yy999; } } yy1166: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1168; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1168; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1168; goto yy999; } } yy1167: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1169; if (yych <= '/') goto yy999; goto yy1170; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1170; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1170; goto yy999; } } yy1168: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1170; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1170; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1170; goto yy999; } } yy1169: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1171; if (yych <= '/') goto yy999; goto yy1172; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1172; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1172; goto yy999; } } yy1170: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1172; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1172; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1172; goto yy999; } } yy1171: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1173; if (yych <= '/') goto yy999; goto yy1174; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1174; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1174; goto yy999; } } yy1172: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1174; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1174; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1174; goto yy999; } } yy1173: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1175; if (yych <= '/') goto yy999; goto yy1176; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1176; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1176; goto yy999; } } yy1174: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1176; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1176; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1176; goto yy999; } } yy1175: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1177; if (yych <= '/') goto yy999; goto yy1178; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1178; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1178; goto yy999; } } yy1176: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1178; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1178; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1178; goto yy999; } } yy1177: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1179; if (yych <= '/') goto yy999; goto yy1180; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1180; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1180; goto yy999; } } yy1178: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1180; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1180; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1180; goto yy999; } } yy1179: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1181; if (yych <= '/') goto yy999; goto yy1182; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1182; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1182; goto yy999; } } yy1180: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1182; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1182; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1182; goto yy999; } } yy1181: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1183; if (yych <= '/') goto yy999; goto yy1184; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1184; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1184; goto yy999; } } yy1182: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1184; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1184; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1184; goto yy999; } } yy1183: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1185; if (yych <= '/') goto yy999; goto yy1186; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1186; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1186; goto yy999; } } yy1184: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1186; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1186; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1186; goto yy999; } } yy1185: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1187; if (yych <= '/') goto yy999; goto yy1188; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1188; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1188; goto yy999; } } yy1186: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1188; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1188; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1188; goto yy999; } } yy1187: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1189; if (yych <= '/') goto yy999; goto yy1190; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1190; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1190; goto yy999; } } yy1188: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1190; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1190; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1190; goto yy999; } } yy1189: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1191; if (yych <= '/') goto yy999; goto yy1192; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1192; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1192; goto yy999; } } yy1190: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1192; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1192; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1192; goto yy999; } } yy1191: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1193; if (yych <= '/') goto yy999; goto yy1194; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1194; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1194; goto yy999; } } yy1192: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1194; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1194; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1194; goto yy999; } } yy1193: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1195; if (yych <= '/') goto yy999; goto yy1196; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1196; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1196; goto yy999; } } yy1194: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1196; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1196; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1196; goto yy999; } } yy1195: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1197; if (yych <= '/') goto yy999; goto yy1198; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1198; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1198; goto yy999; } } yy1196: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1198; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1198; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1198; goto yy999; } } yy1197: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1199; if (yych <= '/') goto yy999; goto yy1200; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1200; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1200; goto yy999; } } yy1198: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1200; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1200; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1200; goto yy999; } } yy1199: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1201; if (yych <= '/') goto yy999; goto yy1202; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1202; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1202; goto yy999; } } yy1200: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1202; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1202; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1202; goto yy999; } } yy1201: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1203; if (yych <= '/') goto yy999; goto yy1204; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1204; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1204; goto yy999; } } yy1202: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1204; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1204; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1204; goto yy999; } } yy1203: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1205; if (yych <= '/') goto yy999; goto yy1206; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1206; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1206; goto yy999; } } yy1204: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1206; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1206; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1206; goto yy999; } } yy1205: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1207; if (yych <= '/') goto yy999; goto yy1208; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1208; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1208; goto yy999; } } yy1206: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1208; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1208; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1208; goto yy999; } } yy1207: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1209; if (yych <= '/') goto yy999; goto yy1210; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1210; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1210; goto yy999; } } yy1208: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1210; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1210; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1210; goto yy999; } } yy1209: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1211; if (yych <= '/') goto yy999; goto yy1212; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1212; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1212; goto yy999; } } yy1210: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1212; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1212; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1212; goto yy999; } } yy1211: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1213; if (yych <= '/') goto yy999; goto yy1214; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1214; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1214; goto yy999; } } yy1212: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1214; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1214; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1214; goto yy999; } } yy1213: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1215; if (yych <= '/') goto yy999; goto yy1216; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1216; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1216; goto yy999; } } yy1214: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1216; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1216; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1216; goto yy999; } } yy1215: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1217; if (yych <= '/') goto yy999; goto yy1218; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1218; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1218; goto yy999; } } yy1216: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1218; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1218; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1218; goto yy999; } } yy1217: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1219; if (yych <= '/') goto yy999; goto yy1220; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1220; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1220; goto yy999; } } yy1218: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1220; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1220; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1220; goto yy999; } } yy1219: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1221; if (yych <= '/') goto yy999; goto yy1222; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1222; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1222; goto yy999; } } yy1220: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1222; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1222; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1222; goto yy999; } } yy1221: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1223; if (yych <= '/') goto yy999; goto yy1224; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1224; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1224; goto yy999; } } yy1222: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1224; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1224; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1224; goto yy999; } } yy1223: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1225; if (yych <= '/') goto yy999; goto yy1226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1226; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1226; goto yy999; } } yy1224: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1226; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1226; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1226; goto yy999; } } yy1225: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1227; if (yych <= '/') goto yy999; goto yy1228; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1228; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1228; goto yy999; } } yy1226: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1228; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1228; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1228; goto yy999; } } yy1227: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1229; if (yych <= '/') goto yy999; goto yy1230; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1230; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1230; goto yy999; } } yy1228: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1230; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1230; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1230; goto yy999; } } yy1229: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1231; if (yych <= '/') goto yy999; goto yy1232; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1232; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1232; goto yy999; } } yy1230: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1232; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1232; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1232; goto yy999; } } yy1231: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1233; if (yych <= '/') goto yy999; goto yy1234; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1234; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1234; goto yy999; } } yy1232: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1234; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1234; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1234; goto yy999; } } yy1233: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1235; if (yych <= '/') goto yy999; goto yy1236; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1236; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1236; goto yy999; } } yy1234: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1236; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1236; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1236; goto yy999; } } yy1235: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1237; if (yych <= '/') goto yy999; goto yy1238; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1238; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1238; goto yy999; } } yy1236: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1238; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1238; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1238; goto yy999; } } yy1237: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1239; if (yych <= '/') goto yy999; goto yy1240; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1240; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1240; goto yy999; } } yy1238: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1240; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1240; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1240; goto yy999; } } yy1239: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1241; if (yych <= '/') goto yy999; goto yy1242; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1242; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1242; goto yy999; } } yy1240: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1242; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1242; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1242; goto yy999; } } yy1241: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1243; if (yych <= '/') goto yy999; goto yy1244; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1244; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1244; goto yy999; } } yy1242: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1244; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1244; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1244; goto yy999; } } yy1243: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1245; if (yych <= '/') goto yy999; goto yy1246; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1246; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1246; goto yy999; } } yy1244: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1246; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1246; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1246; goto yy999; } } yy1245: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1247; if (yych <= '/') goto yy999; goto yy1248; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1248; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1248; goto yy999; } } yy1246: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1248; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1248; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1248; goto yy999; } } yy1247: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1249; if (yych <= '/') goto yy999; goto yy1250; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1250; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1250; goto yy999; } } yy1248: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1250; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1250; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1250; goto yy999; } } yy1249: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1251; if (yych <= '/') goto yy999; goto yy1252; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1252; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1252; goto yy999; } } yy1250: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1252; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1252; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1252; goto yy999; } } yy1251: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1253; if (yych <= '/') goto yy999; goto yy1254; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1254; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1254; goto yy999; } } yy1252: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1254; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1254; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1254; goto yy999; } } yy1253: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1255; if (yych <= '/') goto yy999; goto yy1256; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1256; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1256; goto yy999; } } yy1254: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1256; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1256; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1256; goto yy999; } } yy1255: yych = *++p; if (yych <= '9') { if (yych == '-') goto yy1257; if (yych <= '/') goto yy999; goto yy1258; } else { if (yych <= 'Z') { if (yych <= '@') goto yy999; goto yy1258; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1258; goto yy999; } } yy1256: yych = *++p; if (yych <= '=') { if (yych <= '.') { if (yych <= ',') goto yy999; if (yych >= '.') goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1258; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1258; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1258; goto yy999; } } yy1257: yych = *++p; if (yych <= '@') { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1138; goto yy999; } else { if (yych <= 'Z') goto yy1138; if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1138; goto yy999; } yy1258: ++p; if ((yych = *p) <= '=') { if (yych <= '.') { if (yych <= '-') goto yy999; goto yy1012; } else { if (yych <= '/') goto yy999; if (yych <= '9') goto yy1138; goto yy999; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1013; if (yych <= '@') goto yy999; goto yy1138; } else { if (yych <= '`') goto yy999; if (yych <= 'z') goto yy1138; goto yy999; } } } } // Try to match an HTML tag after first <, returning num of chars matched. bufsize_t _scan_html_tag(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { /* table 1 .. 8: 0 */ 0, 230, 230, 230, 230, 230, 230, 230, 230, 199, 199, 199, 199, 199, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 230, 199, 230, 70, 230, 230, 230, 230, 134, 230, 230, 230, 230, 230, 254, 246, 230, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 246, 230, 198, 198, 196, 230, 230, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 230, 230, 226, 230, 246, 198, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 254, 230, 230, 230, 230, 230, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* table 9 .. 11: 256 */ 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 32, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 128, 160, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= '`') { if (yych <= '.') { if (yych <= '\n') { if (yych <= '\t') goto yy1266; } else { if (yych == '!') goto yy1264; goto yy1266; } } else { if (yych <= '?') { if (yych <= '/') goto yy1263; if (yych <= '>') goto yy1266; goto yy1265; } else { if (yych <= '@') goto yy1266; if (yych <= 'Z') goto yy1262; goto yy1266; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 'z') goto yy1262; if (yych <= 0x7F) goto yy1266; } else { if (yych <= 0xDF) goto yy1267; if (yych <= 0xE0) goto yy1269; goto yy1270; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1274; if (yych <= 0xEF) goto yy1270; goto yy1271; } else { if (yych <= 0xF3) goto yy1272; if (yych <= 0xF4) goto yy1273; } } } yy1261 : { return 0; } yy1262: yych = *(marker = ++p); if (yych <= '/') { if (yych <= ' ') { if (yych <= 0x08) goto yy1261; if (yych <= '\r') goto yy1366; if (yych <= 0x1F) goto yy1261; goto yy1366; } else { if (yych == '-') goto yy1364; if (yych <= '.') goto yy1261; goto yy1368; } } else { if (yych <= '@') { if (yych <= '9') goto yy1364; if (yych == '>') goto yy1285; goto yy1261; } else { if (yych <= 'Z') goto yy1364; if (yych <= '`') goto yy1261; if (yych <= 'z') goto yy1364; goto yy1261; } } yy1263: yych = *(marker = ++p); if (yych <= '@') goto yy1261; if (yych <= 'Z') goto yy1360; if (yych <= '`') goto yy1261; if (yych <= 'z') goto yy1360; goto yy1261; yy1264: yych = *(marker = ++p); if (yybm[256 + yych] & 64) { goto yy1295; } if (yych == '-') goto yy1297; if (yych <= '@') goto yy1261; if (yych <= '[') goto yy1294; goto yy1261; yy1265: yych = *(marker = ++p); if (yych <= 0x00) goto yy1261; if (yych <= 0x7F) goto yy1276; if (yych <= 0xC1) goto yy1261; if (yych <= 0xF4) goto yy1276; goto yy1261; yy1266: yych = *++p; goto yy1261; yy1267: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1266; yy1268: p = marker; goto yy1261; yy1269: yych = *++p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1267; goto yy1268; yy1270: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1267; goto yy1268; yy1271: yych = *++p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1270; goto yy1268; yy1272: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1270; goto yy1268; yy1273: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1270; goto yy1268; yy1274: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1267; goto yy1268; yy1275: ++p; yych = *p; yy1276: if (yybm[256 + yych] & 32) { goto yy1275; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych <= '?') goto yy1284; goto yy1268; } else { if (yych <= 0xDF) goto yy1277; if (yych <= 0xE0) goto yy1278; goto yy1279; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1283; if (yych <= 0xEF) goto yy1279; goto yy1280; } else { if (yych <= 0xF3) goto yy1281; if (yych <= 0xF4) goto yy1282; goto yy1268; } } yy1277: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1275; goto yy1268; yy1278: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1277; goto yy1268; yy1279: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1277; goto yy1268; yy1280: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1279; goto yy1268; yy1281: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1279; goto yy1268; yy1282: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1279; goto yy1268; yy1283: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1277; goto yy1268; yy1284: ++p; yych = *p; if (yych <= 0xE0) { if (yych <= '>') { if (yych <= 0x00) goto yy1268; if (yych <= '=') goto yy1275; } else { if (yych <= 0x7F) goto yy1275; if (yych <= 0xC1) goto yy1268; if (yych <= 0xDF) goto yy1287; goto yy1288; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1293; goto yy1289; } else { if (yych <= 0xF0) goto yy1290; if (yych <= 0xF3) goto yy1291; if (yych <= 0xF4) goto yy1292; goto yy1268; } } yy1285: ++p; { return (bufsize_t)(p - start); } yy1287: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1275; goto yy1268; yy1288: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1287; goto yy1268; yy1289: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1287; goto yy1268; yy1290: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1289; goto yy1268; yy1291: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1289; goto yy1268; yy1292: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1289; goto yy1268; yy1293: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1287; goto yy1268; yy1294: yych = *++p; if (yych == 'C') goto yy1330; if (yych == 'c') goto yy1330; goto yy1268; yy1295: ++p; yych = *p; if (yybm[0 + yych] & 1) { goto yy1319; } if (yych <= '@') goto yy1268; if (yych <= 'Z') goto yy1295; goto yy1268; yy1297: yych = *++p; if (yych != '-') goto yy1268; yych = *++p; if (yych <= 0xE0) { if (yych <= '=') { if (yych != '-') goto yy1301; } else { if (yych <= '>') goto yy1268; if (yych <= 0xC1) goto yy1301; if (yych <= 0xDF) goto yy1302; goto yy1303; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1308; goto yy1304; } else { if (yych <= 0xF0) goto yy1305; if (yych <= 0xF3) goto yy1306; if (yych <= 0xF4) goto yy1307; goto yy1301; } } yych = *++p; if (yych <= 0xE0) { if (yych <= '=') { if (yych == '-') goto yy1318; goto yy1301; } else { if (yych <= '>') goto yy1268; if (yych <= 0xC1) goto yy1301; if (yych <= 0xDF) goto yy1302; goto yy1303; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1308; goto yy1304; } else { if (yych <= 0xF0) goto yy1305; if (yych <= 0xF3) goto yy1306; if (yych <= 0xF4) goto yy1307; goto yy1301; } } yy1300: ++p; yych = *p; yy1301: if (yybm[256 + yych] & 128) { goto yy1300; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych <= '-') goto yy1309; goto yy1268; } else { if (yych <= 0xDF) goto yy1310; if (yych <= 0xE0) goto yy1311; goto yy1312; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1316; if (yych <= 0xEF) goto yy1312; goto yy1313; } else { if (yych <= 0xF3) goto yy1314; if (yych <= 0xF4) goto yy1315; goto yy1268; } } yy1302: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1300; goto yy1268; yy1303: yych = *++p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1302; goto yy1268; yy1304: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1302; goto yy1268; yy1305: yych = *++p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1304; goto yy1268; yy1306: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1304; goto yy1268; yy1307: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1304; goto yy1268; yy1308: yych = *++p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1302; goto yy1268; yy1309: ++p; yych = *p; if (yybm[256 + yych] & 128) { goto yy1300; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych <= '-') goto yy1317; goto yy1268; } else { if (yych <= 0xDF) goto yy1310; if (yych <= 0xE0) goto yy1311; goto yy1312; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1316; if (yych <= 0xEF) goto yy1312; goto yy1313; } else { if (yych <= 0xF3) goto yy1314; if (yych <= 0xF4) goto yy1315; goto yy1268; } } yy1310: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1300; goto yy1268; yy1311: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1310; goto yy1268; yy1312: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1310; goto yy1268; yy1313: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1312; goto yy1268; yy1314: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1312; goto yy1268; yy1315: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1312; goto yy1268; yy1316: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1310; goto yy1268; yy1317: yych = *++p; if (yych == '>') goto yy1285; goto yy1268; yy1318: yych = *++p; if (yych == '>') goto yy1285; goto yy1268; yy1319: ++p; yych = *p; if (yybm[0 + yych] & 1) { goto yy1319; } if (yych <= 0xE0) { if (yych <= '>') { if (yych <= 0x00) goto yy1268; if (yych >= '>') goto yy1285; } else { if (yych <= 0x7F) goto yy1321; if (yych <= 0xC1) goto yy1268; if (yych <= 0xDF) goto yy1323; goto yy1324; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1329; goto yy1325; } else { if (yych <= 0xF0) goto yy1326; if (yych <= 0xF3) goto yy1327; if (yych <= 0xF4) goto yy1328; goto yy1268; } } yy1321: ++p; yych = *p; if (yybm[0 + yych] & 2) { goto yy1321; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych <= '>') goto yy1285; goto yy1268; } else { if (yych <= 0xDF) goto yy1323; if (yych <= 0xE0) goto yy1324; goto yy1325; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1329; if (yych <= 0xEF) goto yy1325; goto yy1326; } else { if (yych <= 0xF3) goto yy1327; if (yych <= 0xF4) goto yy1328; goto yy1268; } } yy1323: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1321; goto yy1268; yy1324: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1323; goto yy1268; yy1325: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1323; goto yy1268; yy1326: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1325; goto yy1268; yy1327: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1325; goto yy1268; yy1328: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1325; goto yy1268; yy1329: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1323; goto yy1268; yy1330: yych = *++p; if (yych == 'D') goto yy1331; if (yych != 'd') goto yy1268; yy1331: yych = *++p; if (yych == 'A') goto yy1332; if (yych != 'a') goto yy1268; yy1332: yych = *++p; if (yych == 'T') goto yy1333; if (yych != 't') goto yy1268; yy1333: yych = *++p; if (yych == 'A') goto yy1334; if (yych != 'a') goto yy1268; yy1334: yych = *++p; if (yych != '[') goto yy1268; yy1335: ++p; yych = *p; if (yybm[0 + yych] & 4) { goto yy1335; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych <= ']') goto yy1344; goto yy1268; } else { if (yych <= 0xDF) goto yy1337; if (yych <= 0xE0) goto yy1338; goto yy1339; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1343; if (yych <= 0xEF) goto yy1339; goto yy1340; } else { if (yych <= 0xF3) goto yy1341; if (yych <= 0xF4) goto yy1342; goto yy1268; } } yy1337: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1335; goto yy1268; yy1338: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1337; goto yy1268; yy1339: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1337; goto yy1268; yy1340: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1339; goto yy1268; yy1341: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1339; goto yy1268; yy1342: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1339; goto yy1268; yy1343: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1337; goto yy1268; yy1344: ++p; yych = *p; if (yybm[0 + yych] & 4) { goto yy1335; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych >= '^') goto yy1268; } else { if (yych <= 0xDF) goto yy1346; if (yych <= 0xE0) goto yy1347; goto yy1348; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1352; if (yych <= 0xEF) goto yy1348; goto yy1349; } else { if (yych <= 0xF3) goto yy1350; if (yych <= 0xF4) goto yy1351; goto yy1268; } } ++p; yych = *p; if (yych <= 0xE0) { if (yych <= '>') { if (yych <= 0x00) goto yy1268; if (yych <= '=') goto yy1335; goto yy1285; } else { if (yych <= 0x7F) goto yy1335; if (yych <= 0xC1) goto yy1268; if (yych <= 0xDF) goto yy1353; goto yy1354; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1359; goto yy1355; } else { if (yych <= 0xF0) goto yy1356; if (yych <= 0xF3) goto yy1357; if (yych <= 0xF4) goto yy1358; goto yy1268; } } yy1346: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1335; goto yy1268; yy1347: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1346; goto yy1268; yy1348: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1346; goto yy1268; yy1349: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1348; goto yy1268; yy1350: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1348; goto yy1268; yy1351: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1348; goto yy1268; yy1352: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1346; goto yy1268; yy1353: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1335; goto yy1268; yy1354: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1353; goto yy1268; yy1355: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1353; goto yy1268; yy1356: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1355; goto yy1268; yy1357: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1355; goto yy1268; yy1358: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1355; goto yy1268; yy1359: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1353; goto yy1268; yy1360: ++p; yych = *p; if (yybm[0 + yych] & 8) { goto yy1360; } if (yych <= 0x1F) { if (yych <= 0x08) goto yy1268; if (yych >= 0x0E) goto yy1268; } else { if (yych <= ' ') goto yy1362; if (yych == '>') goto yy1285; goto yy1268; } yy1362: ++p; yych = *p; if (yych <= 0x1F) { if (yych <= 0x08) goto yy1268; if (yych <= '\r') goto yy1362; goto yy1268; } else { if (yych <= ' ') goto yy1362; if (yych == '>') goto yy1285; goto yy1268; } yy1364: ++p; yych = *p; if (yych <= '/') { if (yych <= ' ') { if (yych <= 0x08) goto yy1268; if (yych <= '\r') goto yy1366; if (yych <= 0x1F) goto yy1268; } else { if (yych == '-') goto yy1364; if (yych <= '.') goto yy1268; goto yy1368; } } else { if (yych <= '@') { if (yych <= '9') goto yy1364; if (yych == '>') goto yy1285; goto yy1268; } else { if (yych <= 'Z') goto yy1364; if (yych <= '`') goto yy1268; if (yych <= 'z') goto yy1364; goto yy1268; } } yy1366: ++p; yych = *p; if (yych <= ':') { if (yych <= ' ') { if (yych <= 0x08) goto yy1268; if (yych <= '\r') goto yy1366; if (yych <= 0x1F) goto yy1268; goto yy1366; } else { if (yych == '/') goto yy1368; if (yych <= '9') goto yy1268; goto yy1369; } } else { if (yych <= 'Z') { if (yych == '>') goto yy1285; if (yych <= '@') goto yy1268; goto yy1369; } else { if (yych <= '_') { if (yych <= '^') goto yy1268; goto yy1369; } else { if (yych <= '`') goto yy1268; if (yych <= 'z') goto yy1369; goto yy1268; } } } yy1368: yych = *++p; if (yych == '>') goto yy1285; goto yy1268; yy1369: ++p; yych = *p; if (yybm[0 + yych] & 16) { goto yy1369; } if (yych <= ',') { if (yych <= '\r') { if (yych <= 0x08) goto yy1268; } else { if (yych != ' ') goto yy1268; } } else { if (yych <= '<') { if (yych <= '/') goto yy1368; goto yy1268; } else { if (yych <= '=') goto yy1373; if (yych <= '>') goto yy1285; goto yy1268; } } yy1371: ++p; yych = *p; if (yych <= '<') { if (yych <= ' ') { if (yych <= 0x08) goto yy1268; if (yych <= '\r') goto yy1371; if (yych <= 0x1F) goto yy1268; goto yy1371; } else { if (yych <= '/') { if (yych <= '.') goto yy1268; goto yy1368; } else { if (yych == ':') goto yy1369; goto yy1268; } } } else { if (yych <= 'Z') { if (yych <= '=') goto yy1373; if (yych <= '>') goto yy1285; if (yych <= '@') goto yy1268; goto yy1369; } else { if (yych <= '_') { if (yych <= '^') goto yy1268; goto yy1369; } else { if (yych <= '`') goto yy1268; if (yych <= 'z') goto yy1369; goto yy1268; } } } yy1373: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1375; } if (yych <= 0xE0) { if (yych <= '"') { if (yych <= 0x00) goto yy1268; if (yych >= '!') goto yy1386; } else { if (yych <= '\'') goto yy1384; if (yych <= 0xC1) goto yy1268; if (yych <= 0xDF) goto yy1377; goto yy1378; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1383; goto yy1379; } else { if (yych <= 0xF0) goto yy1380; if (yych <= 0xF3) goto yy1381; if (yych <= 0xF4) goto yy1382; goto yy1268; } } ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1375; } if (yych <= 0xDF) { if (yych <= '\'') { if (yych <= 0x00) goto yy1268; if (yych <= ' ') goto yy1409; if (yych <= '"') goto yy1386; goto yy1384; } else { if (yych == '>') goto yy1285; if (yych <= 0xC1) goto yy1268; goto yy1377; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1378; if (yych == 0xED) goto yy1383; goto yy1379; } else { if (yych <= 0xF0) goto yy1380; if (yych <= 0xF3) goto yy1381; if (yych <= 0xF4) goto yy1382; goto yy1268; } } yy1375: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1375; } if (yych <= 0xE0) { if (yych <= '=') { if (yych <= 0x00) goto yy1268; if (yych <= ' ') goto yy1403; goto yy1268; } else { if (yych <= '>') goto yy1285; if (yych <= 0xC1) goto yy1268; if (yych >= 0xE0) goto yy1378; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1383; goto yy1379; } else { if (yych <= 0xF0) goto yy1380; if (yych <= 0xF3) goto yy1381; if (yych <= 0xF4) goto yy1382; goto yy1268; } } yy1377: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1375; goto yy1268; yy1378: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1377; goto yy1268; yy1379: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1377; goto yy1268; yy1380: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1379; goto yy1268; yy1381: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1379; goto yy1268; yy1382: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1379; goto yy1268; yy1383: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1377; goto yy1268; yy1384: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1384; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych <= '\'') goto yy1395; goto yy1268; } else { if (yych <= 0xDF) goto yy1396; if (yych <= 0xE0) goto yy1397; goto yy1398; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1402; if (yych <= 0xEF) goto yy1398; goto yy1399; } else { if (yych <= 0xF3) goto yy1400; if (yych <= 0xF4) goto yy1401; goto yy1268; } } yy1386: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1386; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1268; if (yych <= '"') goto yy1395; goto yy1268; } else { if (yych <= 0xDF) goto yy1388; if (yych <= 0xE0) goto yy1389; goto yy1390; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1394; if (yych <= 0xEF) goto yy1390; goto yy1391; } else { if (yych <= 0xF3) goto yy1392; if (yych <= 0xF4) goto yy1393; goto yy1268; } } yy1388: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1386; goto yy1268; yy1389: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1388; goto yy1268; yy1390: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1388; goto yy1268; yy1391: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1390; goto yy1268; yy1392: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1390; goto yy1268; yy1393: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1390; goto yy1268; yy1394: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1388; goto yy1268; yy1395: ++p; yych = *p; if (yych <= ' ') { if (yych <= 0x08) goto yy1268; if (yych <= '\r') goto yy1366; if (yych <= 0x1F) goto yy1268; goto yy1366; } else { if (yych <= '/') { if (yych <= '.') goto yy1268; goto yy1368; } else { if (yych == '>') goto yy1285; goto yy1268; } } yy1396: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1384; goto yy1268; yy1397: ++p; yych = *p; if (yych <= 0x9F) goto yy1268; if (yych <= 0xBF) goto yy1396; goto yy1268; yy1398: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1396; goto yy1268; yy1399: ++p; yych = *p; if (yych <= 0x8F) goto yy1268; if (yych <= 0xBF) goto yy1398; goto yy1268; yy1400: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0xBF) goto yy1398; goto yy1268; yy1401: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x8F) goto yy1398; goto yy1268; yy1402: ++p; yych = *p; if (yych <= 0x7F) goto yy1268; if (yych <= 0x9F) goto yy1396; goto yy1268; yy1403: ++p; yych = *p; if (yych <= '@') { if (yych <= '"') { if (yych <= '\r') { if (yych <= 0x00) goto yy1268; if (yych <= 0x08) goto yy1375; goto yy1403; } else { if (yych == ' ') goto yy1403; if (yych <= '!') goto yy1375; goto yy1268; } } else { if (yych <= ':') { if (yych == '\'') goto yy1268; if (yych <= '9') goto yy1375; } else { if (yych <= ';') goto yy1375; if (yych <= '=') goto yy1268; if (yych <= '>') goto yy1285; goto yy1375; } } } else { if (yych <= 0xDF) { if (yych <= '`') { if (yych <= 'Z') goto yy1405; if (yych <= '^') goto yy1375; if (yych >= '`') goto yy1268; } else { if (yych <= 'z') goto yy1405; if (yych <= 0x7F) goto yy1375; if (yych <= 0xC1) goto yy1268; goto yy1377; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1378; if (yych == 0xED) goto yy1383; goto yy1379; } else { if (yych <= 0xF0) goto yy1380; if (yych <= 0xF3) goto yy1381; if (yych <= 0xF4) goto yy1382; goto yy1268; } } } yy1405: ++p; yych = *p; if (yych <= '>') { if (yych <= '&') { if (yych <= 0x1F) { if (yych <= 0x00) goto yy1268; if (yych <= 0x08) goto yy1375; if (yych >= 0x0E) goto yy1375; } else { if (yych <= ' ') goto yy1407; if (yych == '"') goto yy1268; goto yy1375; } } else { if (yych <= '/') { if (yych <= '\'') goto yy1268; if (yych <= ',') goto yy1375; if (yych <= '.') goto yy1405; goto yy1375; } else { if (yych <= ';') { if (yych <= ':') goto yy1405; goto yy1375; } else { if (yych <= '<') goto yy1268; if (yych <= '=') goto yy1373; goto yy1285; } } } } else { if (yych <= 0xC1) { if (yych <= '_') { if (yych <= '@') goto yy1375; if (yych <= 'Z') goto yy1405; if (yych <= '^') goto yy1375; goto yy1405; } else { if (yych <= '`') goto yy1268; if (yych <= 'z') goto yy1405; if (yych <= 0x7F) goto yy1375; goto yy1268; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1377; if (yych <= 0xE0) goto yy1378; if (yych <= 0xEC) goto yy1379; goto yy1383; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1379; goto yy1380; } else { if (yych <= 0xF3) goto yy1381; if (yych <= 0xF4) goto yy1382; goto yy1268; } } } } yy1407: ++p; yych = *p; if (yych <= '@') { if (yych <= '&') { if (yych <= 0x1F) { if (yych <= 0x00) goto yy1268; if (yych <= 0x08) goto yy1375; if (yych <= '\r') goto yy1407; goto yy1375; } else { if (yych <= ' ') goto yy1407; if (yych == '"') goto yy1268; goto yy1375; } } else { if (yych <= ';') { if (yych <= '\'') goto yy1268; if (yych == ':') goto yy1405; goto yy1375; } else { if (yych <= '<') goto yy1268; if (yych <= '=') goto yy1373; if (yych <= '>') goto yy1285; goto yy1375; } } } else { if (yych <= 0xDF) { if (yych <= '`') { if (yych <= 'Z') goto yy1405; if (yych <= '^') goto yy1375; if (yych <= '_') goto yy1405; goto yy1268; } else { if (yych <= 'z') goto yy1405; if (yych <= 0x7F) goto yy1375; if (yych <= 0xC1) goto yy1268; goto yy1377; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1378; if (yych == 0xED) goto yy1383; goto yy1379; } else { if (yych <= 0xF0) goto yy1380; if (yych <= 0xF3) goto yy1381; if (yych <= 0xF4) goto yy1382; goto yy1268; } } } yy1409: ++p; yych = *p; if (yych <= '@') { if (yych <= '"') { if (yych <= '\r') { if (yych <= 0x00) goto yy1268; if (yych <= 0x08) goto yy1375; goto yy1409; } else { if (yych == ' ') goto yy1409; if (yych <= '!') goto yy1375; goto yy1386; } } else { if (yych <= ':') { if (yych == '\'') goto yy1384; if (yych <= '9') goto yy1375; goto yy1405; } else { if (yych <= ';') goto yy1375; if (yych <= '=') goto yy1268; if (yych <= '>') goto yy1285; goto yy1375; } } } else { if (yych <= 0xDF) { if (yych <= '`') { if (yych <= 'Z') goto yy1405; if (yych <= '^') goto yy1375; if (yych <= '_') goto yy1405; goto yy1268; } else { if (yych <= 'z') goto yy1405; if (yych <= 0x7F) goto yy1375; if (yych <= 0xC1) goto yy1268; goto yy1377; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1378; if (yych == 0xED) goto yy1383; goto yy1379; } else { if (yych <= 0xF0) goto yy1380; if (yych <= 0xF3) goto yy1381; if (yych <= 0xF4) goto yy1382; goto yy1268; } } } } } // Try to match an HTML block tag start line, returning // an integer code for the type of block (1-6, matching the spec). // #7 is handled by a separate function, below. bufsize_t _scan_html_block_start(const unsigned char *p) { const unsigned char *marker = NULL; { unsigned char yych; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= ';') { if (yych != '\n') goto yy1415; } else { if (yych <= '<') goto yy1414; if (yych <= 0x7F) goto yy1415; if (yych >= 0xC2) goto yy1416; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1418; if (yych == 0xED) goto yy1423; goto yy1419; } else { if (yych <= 0xF0) goto yy1420; if (yych <= 0xF3) goto yy1421; if (yych <= 0xF4) goto yy1422; } } yy1413 : { return 0; } yy1414: yych = *(marker = ++p); switch (yych) { case '!': goto yy1440; case '/': goto yy1424; case '?': goto yy1441; case 'A': case 'a': goto yy1426; case 'B': case 'b': goto yy1427; case 'C': case 'c': goto yy1428; case 'D': case 'd': goto yy1429; case 'F': case 'f': goto yy1430; case 'H': case 'h': goto yy1431; case 'I': case 'i': goto yy1432; case 'L': case 'l': goto yy1433; case 'M': case 'm': goto yy1434; case 'N': case 'n': goto yy1435; case 'O': case 'o': goto yy1436; case 'P': case 'p': goto yy1425; case 'S': case 's': goto yy1437; case 'T': case 't': goto yy1438; case 'U': case 'u': goto yy1439; default: goto yy1413; } yy1415: yych = *++p; goto yy1413; yy1416: yych = *++p; if (yych <= 0x7F) goto yy1417; if (yych <= 0xBF) goto yy1415; yy1417: p = marker; goto yy1413; yy1418: yych = *++p; if (yych <= 0x9F) goto yy1417; if (yych <= 0xBF) goto yy1416; goto yy1417; yy1419: yych = *++p; if (yych <= 0x7F) goto yy1417; if (yych <= 0xBF) goto yy1416; goto yy1417; yy1420: yych = *++p; if (yych <= 0x8F) goto yy1417; if (yych <= 0xBF) goto yy1419; goto yy1417; yy1421: yych = *++p; if (yych <= 0x7F) goto yy1417; if (yych <= 0xBF) goto yy1419; goto yy1417; yy1422: yych = *++p; if (yych <= 0x7F) goto yy1417; if (yych <= 0x8F) goto yy1419; goto yy1417; yy1423: yych = *++p; if (yych <= 0x7F) goto yy1417; if (yych <= 0x9F) goto yy1416; goto yy1417; yy1424: yych = *++p; switch (yych) { case 'A': case 'a': goto yy1426; case 'B': case 'b': goto yy1427; case 'C': case 'c': goto yy1428; case 'D': case 'd': goto yy1429; case 'F': case 'f': goto yy1430; case 'H': case 'h': goto yy1431; case 'I': case 'i': goto yy1432; case 'L': case 'l': goto yy1433; case 'M': case 'm': goto yy1434; case 'N': case 'n': goto yy1435; case 'O': case 'o': goto yy1436; case 'P': case 'p': goto yy1625; case 'S': case 's': goto yy1626; case 'T': case 't': goto yy1438; case 'U': case 'u': goto yy1439; default: goto yy1417; } yy1425: yych = *++p; if (yych <= '>') { if (yych <= ' ') { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; if (yych <= 0x1F) goto yy1417; goto yy1457; } else { if (yych == '/') goto yy1459; if (yych <= '=') goto yy1417; goto yy1457; } } else { if (yych <= 'R') { if (yych == 'A') goto yy1622; if (yych <= 'Q') goto yy1417; goto yy1621; } else { if (yych <= 'a') { if (yych <= '`') goto yy1417; goto yy1622; } else { if (yych == 'r') goto yy1621; goto yy1417; } } } yy1426: yych = *++p; if (yych <= 'S') { if (yych <= 'D') { if (yych <= 'C') goto yy1417; goto yy1610; } else { if (yych <= 'Q') goto yy1417; if (yych <= 'R') goto yy1609; goto yy1608; } } else { if (yych <= 'q') { if (yych == 'd') goto yy1610; goto yy1417; } else { if (yych <= 'r') goto yy1609; if (yych <= 's') goto yy1608; goto yy1417; } } yy1427: yych = *++p; if (yych <= 'O') { if (yych <= 'K') { if (yych == 'A') goto yy1594; goto yy1417; } else { if (yych <= 'L') goto yy1593; if (yych <= 'N') goto yy1417; goto yy1592; } } else { if (yych <= 'k') { if (yych == 'a') goto yy1594; goto yy1417; } else { if (yych <= 'l') goto yy1593; if (yych == 'o') goto yy1592; goto yy1417; } } yy1428: yych = *++p; if (yych <= 'O') { if (yych <= 'D') { if (yych == 'A') goto yy1579; goto yy1417; } else { if (yych <= 'E') goto yy1578; if (yych <= 'N') goto yy1417; goto yy1577; } } else { if (yych <= 'd') { if (yych == 'a') goto yy1579; goto yy1417; } else { if (yych <= 'e') goto yy1578; if (yych == 'o') goto yy1577; goto yy1417; } } yy1429: yych = *++p; switch (yych) { case 'D': case 'L': case 'T': case 'd': case 'l': case 't': goto yy1456; case 'E': case 'e': goto yy1569; case 'I': case 'i': goto yy1568; default: goto yy1417; } yy1430: yych = *++p; if (yych <= 'R') { if (yych <= 'N') { if (yych == 'I') goto yy1544; goto yy1417; } else { if (yych <= 'O') goto yy1543; if (yych <= 'Q') goto yy1417; goto yy1542; } } else { if (yych <= 'n') { if (yych == 'i') goto yy1544; goto yy1417; } else { if (yych <= 'o') goto yy1543; if (yych == 'r') goto yy1542; goto yy1417; } } yy1431: yych = *++p; if (yych <= 'S') { if (yych <= 'D') { if (yych == '1') goto yy1456; goto yy1417; } else { if (yych <= 'E') goto yy1537; if (yych == 'R') goto yy1456; goto yy1417; } } else { if (yych <= 'q') { if (yych <= 'T') goto yy1536; if (yych == 'e') goto yy1537; goto yy1417; } else { if (yych <= 'r') goto yy1456; if (yych == 't') goto yy1536; goto yy1417; } } yy1432: yych = *++p; if (yych == 'F') goto yy1532; if (yych == 'f') goto yy1532; goto yy1417; yy1433: yych = *++p; if (yych <= 'I') { if (yych == 'E') goto yy1527; if (yych <= 'H') goto yy1417; goto yy1526; } else { if (yych <= 'e') { if (yych <= 'd') goto yy1417; goto yy1527; } else { if (yych == 'i') goto yy1526; goto yy1417; } } yy1434: yych = *++p; if (yych <= 'E') { if (yych == 'A') goto yy1518; if (yych <= 'D') goto yy1417; goto yy1517; } else { if (yych <= 'a') { if (yych <= '`') goto yy1417; goto yy1518; } else { if (yych == 'e') goto yy1517; goto yy1417; } } yy1435: yych = *++p; if (yych <= 'O') { if (yych == 'A') goto yy1511; if (yych <= 'N') goto yy1417; goto yy1510; } else { if (yych <= 'a') { if (yych <= '`') goto yy1417; goto yy1511; } else { if (yych == 'o') goto yy1510; goto yy1417; } } yy1436: yych = *++p; if (yych <= 'P') { if (yych == 'L') goto yy1456; if (yych <= 'O') goto yy1417; goto yy1502; } else { if (yych <= 'l') { if (yych <= 'k') goto yy1417; goto yy1456; } else { if (yych == 'p') goto yy1502; goto yy1417; } } yy1437: yych = *++p; if (yych <= 'U') { if (yych <= 'E') { if (yych == 'C') goto yy1479; if (yych <= 'D') goto yy1417; goto yy1482; } else { if (yych <= 'O') { if (yych <= 'N') goto yy1417; goto yy1481; } else { if (yych <= 'S') goto yy1417; if (yych <= 'T') goto yy1478; goto yy1480; } } } else { if (yych <= 'n') { if (yych <= 'c') { if (yych <= 'b') goto yy1417; goto yy1479; } else { if (yych == 'e') goto yy1482; goto yy1417; } } else { if (yych <= 's') { if (yych <= 'o') goto yy1481; goto yy1417; } else { if (yych <= 't') goto yy1478; if (yych <= 'u') goto yy1480; goto yy1417; } } } yy1438: yych = *++p; switch (yych) { case 'A': case 'a': goto yy1465; case 'B': case 'b': goto yy1464; case 'D': case 'd': goto yy1456; case 'F': case 'f': goto yy1463; case 'H': case 'h': goto yy1462; case 'I': case 'i': goto yy1461; case 'R': case 'r': goto yy1460; default: goto yy1417; } yy1439: yych = *++p; if (yych == 'L') goto yy1456; if (yych == 'l') goto yy1456; goto yy1417; yy1440: yych = *++p; if (yych <= '@') { if (yych == '-') goto yy1443; goto yy1417; } else { if (yych <= 'Z') goto yy1444; if (yych <= '[') goto yy1446; goto yy1417; } yy1441: ++p; { return 3; } yy1443: yych = *++p; if (yych == '-') goto yy1454; goto yy1417; yy1444: ++p; { return 4; } yy1446: yych = *++p; if (yych == 'C') goto yy1447; if (yych != 'c') goto yy1417; yy1447: yych = *++p; if (yych == 'D') goto yy1448; if (yych != 'd') goto yy1417; yy1448: yych = *++p; if (yych == 'A') goto yy1449; if (yych != 'a') goto yy1417; yy1449: yych = *++p; if (yych == 'T') goto yy1450; if (yych != 't') goto yy1417; yy1450: yych = *++p; if (yych == 'A') goto yy1451; if (yych != 'a') goto yy1417; yy1451: yych = *++p; if (yych != '[') goto yy1417; ++p; { return 5; } yy1454: ++p; { return 2; } yy1456: yych = *++p; if (yych <= ' ') { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; if (yych <= 0x1F) goto yy1417; } else { if (yych <= '/') { if (yych <= '.') goto yy1417; goto yy1459; } else { if (yych != '>') goto yy1417; } } yy1457: ++p; { return 6; } yy1459: yych = *++p; if (yych == '>') goto yy1457; goto yy1417; yy1460: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= '@') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'A') goto yy1476; if (yych == 'a') goto yy1476; goto yy1417; } } yy1461: yych = *++p; if (yych == 'T') goto yy1474; if (yych == 't') goto yy1474; goto yy1417; yy1462: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= 'D') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'E') goto yy1472; if (yych == 'e') goto yy1472; goto yy1417; } } yy1463: yych = *++p; if (yych == 'O') goto yy1470; if (yych == 'o') goto yy1470; goto yy1417; yy1464: yych = *++p; if (yych == 'O') goto yy1468; if (yych == 'o') goto yy1468; goto yy1417; yy1465: yych = *++p; if (yych == 'B') goto yy1466; if (yych != 'b') goto yy1417; yy1466: yych = *++p; if (yych == 'L') goto yy1467; if (yych != 'l') goto yy1417; yy1467: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1468: yych = *++p; if (yych == 'D') goto yy1469; if (yych != 'd') goto yy1417; yy1469: yych = *++p; if (yych == 'Y') goto yy1456; if (yych == 'y') goto yy1456; goto yy1417; yy1470: yych = *++p; if (yych == 'O') goto yy1471; if (yych != 'o') goto yy1417; yy1471: yych = *++p; if (yych == 'T') goto yy1456; if (yych == 't') goto yy1456; goto yy1417; yy1472: yych = *++p; if (yych == 'A') goto yy1473; if (yych != 'a') goto yy1417; yy1473: yych = *++p; if (yych == 'D') goto yy1456; if (yych == 'd') goto yy1456; goto yy1417; yy1474: yych = *++p; if (yych == 'L') goto yy1475; if (yych != 'l') goto yy1417; yy1475: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1476: yych = *++p; if (yych == 'C') goto yy1477; if (yych != 'c') goto yy1417; yy1477: yych = *++p; if (yych == 'K') goto yy1456; if (yych == 'k') goto yy1456; goto yy1417; yy1478: yych = *++p; if (yych == 'Y') goto yy1500; if (yych == 'y') goto yy1500; goto yy1417; yy1479: yych = *++p; if (yych == 'R') goto yy1494; if (yych == 'r') goto yy1494; goto yy1417; yy1480: yych = *++p; if (yych == 'M') goto yy1490; if (yych == 'm') goto yy1490; goto yy1417; yy1481: yych = *++p; if (yych == 'U') goto yy1487; if (yych == 'u') goto yy1487; goto yy1417; yy1482: yych = *++p; if (yych == 'C') goto yy1483; if (yych != 'c') goto yy1417; yy1483: yych = *++p; if (yych == 'T') goto yy1484; if (yych != 't') goto yy1417; yy1484: yych = *++p; if (yych == 'I') goto yy1485; if (yych != 'i') goto yy1417; yy1485: yych = *++p; if (yych == 'O') goto yy1486; if (yych != 'o') goto yy1417; yy1486: yych = *++p; if (yych == 'N') goto yy1456; if (yych == 'n') goto yy1456; goto yy1417; yy1487: yych = *++p; if (yych == 'R') goto yy1488; if (yych != 'r') goto yy1417; yy1488: yych = *++p; if (yych == 'C') goto yy1489; if (yych != 'c') goto yy1417; yy1489: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1490: yych = *++p; if (yych == 'M') goto yy1491; if (yych != 'm') goto yy1417; yy1491: yych = *++p; if (yych == 'A') goto yy1492; if (yych != 'a') goto yy1417; yy1492: yych = *++p; if (yych == 'R') goto yy1493; if (yych != 'r') goto yy1417; yy1493: yych = *++p; if (yych == 'Y') goto yy1456; if (yych == 'y') goto yy1456; goto yy1417; yy1494: yych = *++p; if (yych == 'I') goto yy1495; if (yych != 'i') goto yy1417; yy1495: yych = *++p; if (yych == 'P') goto yy1496; if (yych != 'p') goto yy1417; yy1496: yych = *++p; if (yych == 'T') goto yy1497; if (yych != 't') goto yy1417; yy1497: yych = *++p; if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych >= 0x0E) goto yy1417; } else { if (yych <= ' ') goto yy1498; if (yych != '>') goto yy1417; } yy1498: ++p; { return 1; } yy1500: yych = *++p; if (yych == 'L') goto yy1501; if (yych != 'l') goto yy1417; yy1501: yych = *++p; if (yych == 'E') goto yy1497; if (yych == 'e') goto yy1497; goto yy1417; yy1502: yych = *++p; if (yych == 'T') goto yy1503; if (yych != 't') goto yy1417; yy1503: yych = *++p; if (yych <= 'I') { if (yych == 'G') goto yy1505; if (yych <= 'H') goto yy1417; } else { if (yych <= 'g') { if (yych <= 'f') goto yy1417; goto yy1505; } else { if (yych != 'i') goto yy1417; } } yych = *++p; if (yych == 'O') goto yy1509; if (yych == 'o') goto yy1509; goto yy1417; yy1505: yych = *++p; if (yych == 'R') goto yy1506; if (yych != 'r') goto yy1417; yy1506: yych = *++p; if (yych == 'O') goto yy1507; if (yych != 'o') goto yy1417; yy1507: yych = *++p; if (yych == 'U') goto yy1508; if (yych != 'u') goto yy1417; yy1508: yych = *++p; if (yych == 'P') goto yy1456; if (yych == 'p') goto yy1456; goto yy1417; yy1509: yych = *++p; if (yych == 'N') goto yy1456; if (yych == 'n') goto yy1456; goto yy1417; yy1510: yych = *++p; if (yych == 'F') goto yy1512; if (yych == 'f') goto yy1512; goto yy1417; yy1511: yych = *++p; if (yych == 'V') goto yy1456; if (yych == 'v') goto yy1456; goto yy1417; yy1512: yych = *++p; if (yych == 'R') goto yy1513; if (yych != 'r') goto yy1417; yy1513: yych = *++p; if (yych == 'A') goto yy1514; if (yych != 'a') goto yy1417; yy1514: yych = *++p; if (yych == 'M') goto yy1515; if (yych != 'm') goto yy1417; yy1515: yych = *++p; if (yych == 'E') goto yy1516; if (yych != 'e') goto yy1417; yy1516: yych = *++p; if (yych == 'S') goto yy1456; if (yych == 's') goto yy1456; goto yy1417; yy1517: yych = *++p; if (yych <= 'T') { if (yych == 'N') goto yy1520; if (yych <= 'S') goto yy1417; goto yy1521; } else { if (yych <= 'n') { if (yych <= 'm') goto yy1417; goto yy1520; } else { if (yych == 't') goto yy1521; goto yy1417; } } yy1518: yych = *++p; if (yych == 'I') goto yy1519; if (yych != 'i') goto yy1417; yy1519: yych = *++p; if (yych == 'N') goto yy1456; if (yych == 'n') goto yy1456; goto yy1417; yy1520: yych = *++p; if (yych == 'U') goto yy1522; if (yych == 'u') goto yy1522; goto yy1417; yy1521: yych = *++p; if (yych == 'A') goto yy1456; if (yych == 'a') goto yy1456; goto yy1417; yy1522: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= 'H') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'I') goto yy1523; if (yych != 'i') goto yy1417; } } yy1523: yych = *++p; if (yych == 'T') goto yy1524; if (yych != 't') goto yy1417; yy1524: yych = *++p; if (yych == 'E') goto yy1525; if (yych != 'e') goto yy1417; yy1525: yych = *++p; if (yych == 'M') goto yy1456; if (yych == 'm') goto yy1456; goto yy1417; yy1526: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= 'M') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'N') goto yy1531; if (yych == 'n') goto yy1531; goto yy1417; } } yy1527: yych = *++p; if (yych == 'G') goto yy1528; if (yych != 'g') goto yy1417; yy1528: yych = *++p; if (yych == 'E') goto yy1529; if (yych != 'e') goto yy1417; yy1529: yych = *++p; if (yych == 'N') goto yy1530; if (yych != 'n') goto yy1417; yy1530: yych = *++p; if (yych == 'D') goto yy1456; if (yych == 'd') goto yy1456; goto yy1417; yy1531: yych = *++p; if (yych == 'K') goto yy1456; if (yych == 'k') goto yy1456; goto yy1417; yy1532: yych = *++p; if (yych == 'R') goto yy1533; if (yych != 'r') goto yy1417; yy1533: yych = *++p; if (yych == 'A') goto yy1534; if (yych != 'a') goto yy1417; yy1534: yych = *++p; if (yych == 'M') goto yy1535; if (yych != 'm') goto yy1417; yy1535: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1536: yych = *++p; if (yych == 'M') goto yy1541; if (yych == 'm') goto yy1541; goto yy1417; yy1537: yych = *++p; if (yych == 'A') goto yy1538; if (yych != 'a') goto yy1417; yy1538: yych = *++p; if (yych == 'D') goto yy1539; if (yych != 'd') goto yy1417; yy1539: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= 'D') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'E') goto yy1540; if (yych != 'e') goto yy1417; } } yy1540: yych = *++p; if (yych == 'R') goto yy1456; if (yych == 'r') goto yy1456; goto yy1417; yy1541: yych = *++p; if (yych == 'L') goto yy1456; if (yych == 'l') goto yy1456; goto yy1417; yy1542: yych = *++p; if (yych == 'A') goto yy1563; if (yych == 'a') goto yy1563; goto yy1417; yy1543: yych = *++p; if (yych <= 'R') { if (yych == 'O') goto yy1559; if (yych <= 'Q') goto yy1417; goto yy1560; } else { if (yych <= 'o') { if (yych <= 'n') goto yy1417; goto yy1559; } else { if (yych == 'r') goto yy1560; goto yy1417; } } yy1544: yych = *++p; if (yych <= 'G') { if (yych == 'E') goto yy1545; if (yych <= 'F') goto yy1417; goto yy1546; } else { if (yych <= 'e') { if (yych <= 'd') goto yy1417; } else { if (yych == 'g') goto yy1546; goto yy1417; } } yy1545: yych = *++p; if (yych == 'L') goto yy1555; if (yych == 'l') goto yy1555; goto yy1417; yy1546: yych = *++p; if (yych <= 'U') { if (yych == 'C') goto yy1548; if (yych <= 'T') goto yy1417; } else { if (yych <= 'c') { if (yych <= 'b') goto yy1417; goto yy1548; } else { if (yych != 'u') goto yy1417; } } yych = *++p; if (yych == 'R') goto yy1554; if (yych == 'r') goto yy1554; goto yy1417; yy1548: yych = *++p; if (yych == 'A') goto yy1549; if (yych != 'a') goto yy1417; yy1549: yych = *++p; if (yych == 'P') goto yy1550; if (yych != 'p') goto yy1417; yy1550: yych = *++p; if (yych == 'T') goto yy1551; if (yych != 't') goto yy1417; yy1551: yych = *++p; if (yych == 'I') goto yy1552; if (yych != 'i') goto yy1417; yy1552: yych = *++p; if (yych == 'O') goto yy1553; if (yych != 'o') goto yy1417; yy1553: yych = *++p; if (yych == 'N') goto yy1456; if (yych == 'n') goto yy1456; goto yy1417; yy1554: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1555: yych = *++p; if (yych == 'D') goto yy1556; if (yych != 'd') goto yy1417; yy1556: yych = *++p; if (yych == 'S') goto yy1557; if (yych != 's') goto yy1417; yy1557: yych = *++p; if (yych == 'E') goto yy1558; if (yych != 'e') goto yy1417; yy1558: yych = *++p; if (yych == 'T') goto yy1456; if (yych == 't') goto yy1456; goto yy1417; yy1559: yych = *++p; if (yych == 'T') goto yy1561; if (yych == 't') goto yy1561; goto yy1417; yy1560: yych = *++p; if (yych == 'M') goto yy1456; if (yych == 'm') goto yy1456; goto yy1417; yy1561: yych = *++p; if (yych == 'E') goto yy1562; if (yych != 'e') goto yy1417; yy1562: yych = *++p; if (yych == 'R') goto yy1456; if (yych == 'r') goto yy1456; goto yy1417; yy1563: yych = *++p; if (yych == 'M') goto yy1564; if (yych != 'm') goto yy1417; yy1564: yych = *++p; if (yych == 'E') goto yy1565; if (yych != 'e') goto yy1417; yy1565: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= 'R') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'S') goto yy1566; if (yych != 's') goto yy1417; } } yy1566: yych = *++p; if (yych == 'E') goto yy1567; if (yych != 'e') goto yy1417; yy1567: yych = *++p; if (yych == 'T') goto yy1456; if (yych == 't') goto yy1456; goto yy1417; yy1568: yych = *++p; if (yych <= 'V') { if (yych <= 'Q') { if (yych == 'A') goto yy1574; goto yy1417; } else { if (yych <= 'R') goto yy1456; if (yych <= 'U') goto yy1417; goto yy1456; } } else { if (yych <= 'q') { if (yych == 'a') goto yy1574; goto yy1417; } else { if (yych <= 'r') goto yy1456; if (yych == 'v') goto yy1456; goto yy1417; } } yy1569: yych = *++p; if (yych == 'T') goto yy1570; if (yych != 't') goto yy1417; yy1570: yych = *++p; if (yych == 'A') goto yy1571; if (yych != 'a') goto yy1417; yy1571: yych = *++p; if (yych == 'I') goto yy1572; if (yych != 'i') goto yy1417; yy1572: yych = *++p; if (yych == 'L') goto yy1573; if (yych != 'l') goto yy1417; yy1573: yych = *++p; if (yych == 'S') goto yy1456; if (yych == 's') goto yy1456; goto yy1417; yy1574: yych = *++p; if (yych == 'L') goto yy1575; if (yych != 'l') goto yy1417; yy1575: yych = *++p; if (yych == 'O') goto yy1576; if (yych != 'o') goto yy1417; yy1576: yych = *++p; if (yych == 'G') goto yy1456; if (yych == 'g') goto yy1456; goto yy1417; yy1577: yych = *++p; if (yych == 'L') goto yy1587; if (yych == 'l') goto yy1587; goto yy1417; yy1578: yych = *++p; if (yych == 'N') goto yy1584; if (yych == 'n') goto yy1584; goto yy1417; yy1579: yych = *++p; if (yych == 'P') goto yy1580; if (yych != 'p') goto yy1417; yy1580: yych = *++p; if (yych == 'T') goto yy1581; if (yych != 't') goto yy1417; yy1581: yych = *++p; if (yych == 'I') goto yy1582; if (yych != 'i') goto yy1417; yy1582: yych = *++p; if (yych == 'O') goto yy1583; if (yych != 'o') goto yy1417; yy1583: yych = *++p; if (yych == 'N') goto yy1456; if (yych == 'n') goto yy1456; goto yy1417; yy1584: yych = *++p; if (yych == 'T') goto yy1585; if (yych != 't') goto yy1417; yy1585: yych = *++p; if (yych == 'E') goto yy1586; if (yych != 'e') goto yy1417; yy1586: yych = *++p; if (yych == 'R') goto yy1456; if (yych == 'r') goto yy1456; goto yy1417; yy1587: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= 'F') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'G') goto yy1588; if (yych != 'g') goto yy1417; } } yy1588: yych = *++p; if (yych == 'R') goto yy1589; if (yych != 'r') goto yy1417; yy1589: yych = *++p; if (yych == 'O') goto yy1590; if (yych != 'o') goto yy1417; yy1590: yych = *++p; if (yych == 'U') goto yy1591; if (yych != 'u') goto yy1417; yy1591: yych = *++p; if (yych == 'P') goto yy1456; if (yych == 'p') goto yy1456; goto yy1417; yy1592: yych = *++p; if (yych == 'D') goto yy1607; if (yych == 'd') goto yy1607; goto yy1417; yy1593: yych = *++p; if (yych == 'O') goto yy1600; if (yych == 'o') goto yy1600; goto yy1417; yy1594: yych = *++p; if (yych == 'S') goto yy1595; if (yych != 's') goto yy1417; yy1595: yych = *++p; if (yych == 'E') goto yy1596; if (yych != 'e') goto yy1417; yy1596: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= 'E') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'F') goto yy1597; if (yych != 'f') goto yy1417; } } yy1597: yych = *++p; if (yych == 'O') goto yy1598; if (yych != 'o') goto yy1417; yy1598: yych = *++p; if (yych == 'N') goto yy1599; if (yych != 'n') goto yy1417; yy1599: yych = *++p; if (yych == 'T') goto yy1456; if (yych == 't') goto yy1456; goto yy1417; yy1600: yych = *++p; if (yych == 'C') goto yy1601; if (yych != 'c') goto yy1417; yy1601: yych = *++p; if (yych == 'K') goto yy1602; if (yych != 'k') goto yy1417; yy1602: yych = *++p; if (yych == 'Q') goto yy1603; if (yych != 'q') goto yy1417; yy1603: yych = *++p; if (yych == 'U') goto yy1604; if (yych != 'u') goto yy1417; yy1604: yych = *++p; if (yych == 'O') goto yy1605; if (yych != 'o') goto yy1417; yy1605: yych = *++p; if (yych == 'T') goto yy1606; if (yych != 't') goto yy1417; yy1606: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1607: yych = *++p; if (yych == 'Y') goto yy1456; if (yych == 'y') goto yy1456; goto yy1417; yy1608: yych = *++p; if (yych == 'I') goto yy1619; if (yych == 'i') goto yy1619; goto yy1417; yy1609: yych = *++p; if (yych == 'T') goto yy1615; if (yych == 't') goto yy1615; goto yy1417; yy1610: yych = *++p; if (yych == 'D') goto yy1611; if (yych != 'd') goto yy1417; yy1611: yych = *++p; if (yych == 'R') goto yy1612; if (yych != 'r') goto yy1417; yy1612: yych = *++p; if (yych == 'E') goto yy1613; if (yych != 'e') goto yy1417; yy1613: yych = *++p; if (yych == 'S') goto yy1614; if (yych != 's') goto yy1417; yy1614: yych = *++p; if (yych == 'S') goto yy1456; if (yych == 's') goto yy1456; goto yy1417; yy1615: yych = *++p; if (yych == 'I') goto yy1616; if (yych != 'i') goto yy1417; yy1616: yych = *++p; if (yych == 'C') goto yy1617; if (yych != 'c') goto yy1417; yy1617: yych = *++p; if (yych == 'L') goto yy1618; if (yych != 'l') goto yy1417; yy1618: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1619: yych = *++p; if (yych == 'D') goto yy1620; if (yych != 'd') goto yy1417; yy1620: yych = *++p; if (yych == 'E') goto yy1456; if (yych == 'e') goto yy1456; goto yy1417; yy1621: yych = *++p; if (yych == 'E') goto yy1497; if (yych == 'e') goto yy1497; goto yy1417; yy1622: yych = *++p; if (yych == 'R') goto yy1623; if (yych != 'r') goto yy1417; yy1623: yych = *++p; if (yych == 'A') goto yy1624; if (yych != 'a') goto yy1417; yy1624: yych = *++p; if (yych == 'M') goto yy1456; if (yych == 'm') goto yy1456; goto yy1417; yy1625: yych = *++p; if (yych <= '/') { if (yych <= 0x1F) { if (yych <= 0x08) goto yy1417; if (yych <= '\r') goto yy1457; goto yy1417; } else { if (yych <= ' ') goto yy1457; if (yych <= '.') goto yy1417; goto yy1459; } } else { if (yych <= '@') { if (yych == '>') goto yy1457; goto yy1417; } else { if (yych <= 'A') goto yy1622; if (yych == 'a') goto yy1622; goto yy1417; } } yy1626: ++p; if ((yych = *p) <= 'U') { if (yych <= 'N') { if (yych == 'E') goto yy1482; goto yy1417; } else { if (yych <= 'O') goto yy1481; if (yych <= 'T') goto yy1417; goto yy1480; } } else { if (yych <= 'n') { if (yych == 'e') goto yy1482; goto yy1417; } else { if (yych <= 'o') goto yy1481; if (yych == 'u') goto yy1480; goto yy1417; } } } } // Try to match an HTML block tag start line of type 7, returning // 7 if successful, 0 if not. bufsize_t _scan_html_block_start_7(const unsigned char *p) { const unsigned char *marker = NULL; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 0, 224, 224, 224, 224, 224, 224, 224, 224, 198, 202, 194, 198, 194, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 198, 224, 64, 224, 224, 224, 224, 128, 224, 224, 224, 224, 224, 241, 240, 224, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 240, 224, 192, 192, 192, 224, 224, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 224, 224, 224, 224, 240, 192, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 241, 224, 224, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= ';') { if (yych != '\n') goto yy1631; } else { if (yych <= '<') goto yy1630; if (yych <= 0x7F) goto yy1631; if (yych >= 0xC2) goto yy1632; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1634; if (yych == 0xED) goto yy1639; goto yy1635; } else { if (yych <= 0xF0) goto yy1636; if (yych <= 0xF3) goto yy1637; if (yych <= 0xF4) goto yy1638; } } yy1629 : { return 0; } yy1630: yyaccept = 0; yych = *(marker = ++p); if (yych <= '@') { if (yych == '/') goto yy1642; goto yy1629; } else { if (yych <= 'Z') goto yy1640; if (yych <= '`') goto yy1629; if (yych <= 'z') goto yy1640; goto yy1629; } yy1631: yych = *++p; goto yy1629; yy1632: yych = *++p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1631; yy1633: p = marker; if (yyaccept == 0) { goto yy1629; } else { goto yy1651; } yy1634: yych = *++p; if (yych <= 0x9F) goto yy1633; if (yych <= 0xBF) goto yy1632; goto yy1633; yy1635: yych = *++p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1632; goto yy1633; yy1636: yych = *++p; if (yych <= 0x8F) goto yy1633; if (yych <= 0xBF) goto yy1635; goto yy1633; yy1637: yych = *++p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1635; goto yy1633; yy1638: yych = *++p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x8F) goto yy1635; goto yy1633; yy1639: yych = *++p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x9F) goto yy1632; goto yy1633; yy1640: ++p; yych = *p; if (yybm[0 + yych] & 1) { goto yy1640; } if (yych <= ' ') { if (yych <= 0x08) goto yy1633; if (yych <= '\r') goto yy1653; if (yych <= 0x1F) goto yy1633; goto yy1653; } else { if (yych <= '/') { if (yych <= '.') goto yy1633; goto yy1655; } else { if (yych == '>') goto yy1647; goto yy1633; } } yy1642: yych = *++p; if (yych <= '@') goto yy1633; if (yych <= 'Z') goto yy1643; if (yych <= '`') goto yy1633; if (yych >= '{') goto yy1633; yy1643: ++p; yych = *p; if (yybm[0 + yych] & 2) { goto yy1645; } if (yych <= '=') { if (yych <= '-') { if (yych <= ',') goto yy1633; goto yy1643; } else { if (yych <= '/') goto yy1633; if (yych <= '9') goto yy1643; goto yy1633; } } else { if (yych <= 'Z') { if (yych <= '>') goto yy1647; if (yych <= '@') goto yy1633; goto yy1643; } else { if (yych <= '`') goto yy1633; if (yych <= 'z') goto yy1643; goto yy1633; } } yy1645: ++p; yych = *p; if (yybm[0 + yych] & 2) { goto yy1645; } if (yych != '>') goto yy1633; yy1647: ++p; yych = *p; if (yybm[0 + yych] & 4) { goto yy1647; } if (yych <= 0x08) goto yy1633; if (yych <= '\n') goto yy1649; if (yych <= '\v') goto yy1633; if (yych <= '\r') goto yy1652; goto yy1633; yy1649: yyaccept = 1; marker = ++p; yych = *p; if (yybm[0 + yych] & 4) { goto yy1647; } if (yych <= 0x08) goto yy1651; if (yych <= '\n') goto yy1649; if (yych <= '\v') goto yy1651; if (yych <= '\r') goto yy1652; yy1651 : { return 7; } yy1652: yych = *++p; goto yy1651; yy1653: ++p; yych = *p; if (yych <= ':') { if (yych <= ' ') { if (yych <= 0x08) goto yy1633; if (yych <= '\r') goto yy1653; if (yych <= 0x1F) goto yy1633; goto yy1653; } else { if (yych == '/') goto yy1655; if (yych <= '9') goto yy1633; goto yy1656; } } else { if (yych <= 'Z') { if (yych == '>') goto yy1647; if (yych <= '@') goto yy1633; goto yy1656; } else { if (yych <= '_') { if (yych <= '^') goto yy1633; goto yy1656; } else { if (yych <= '`') goto yy1633; if (yych <= 'z') goto yy1656; goto yy1633; } } } yy1655: yych = *++p; if (yych == '>') goto yy1647; goto yy1633; yy1656: ++p; yych = *p; if (yybm[0 + yych] & 16) { goto yy1656; } if (yych <= ',') { if (yych <= '\r') { if (yych <= 0x08) goto yy1633; } else { if (yych != ' ') goto yy1633; } } else { if (yych <= '<') { if (yych <= '/') goto yy1655; goto yy1633; } else { if (yych <= '=') goto yy1660; if (yych <= '>') goto yy1647; goto yy1633; } } yy1658: ++p; yych = *p; if (yych <= '<') { if (yych <= ' ') { if (yych <= 0x08) goto yy1633; if (yych <= '\r') goto yy1658; if (yych <= 0x1F) goto yy1633; goto yy1658; } else { if (yych <= '/') { if (yych <= '.') goto yy1633; goto yy1655; } else { if (yych == ':') goto yy1656; goto yy1633; } } } else { if (yych <= 'Z') { if (yych <= '=') goto yy1660; if (yych <= '>') goto yy1647; if (yych <= '@') goto yy1633; goto yy1656; } else { if (yych <= '_') { if (yych <= '^') goto yy1633; goto yy1656; } else { if (yych <= '`') goto yy1633; if (yych <= 'z') goto yy1656; goto yy1633; } } } yy1660: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1662; } if (yych <= 0xE0) { if (yych <= '"') { if (yych <= 0x00) goto yy1633; if (yych >= '!') goto yy1673; } else { if (yych <= '\'') goto yy1671; if (yych <= 0xC1) goto yy1633; if (yych <= 0xDF) goto yy1664; goto yy1665; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1670; goto yy1666; } else { if (yych <= 0xF0) goto yy1667; if (yych <= 0xF3) goto yy1668; if (yych <= 0xF4) goto yy1669; goto yy1633; } } ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1662; } if (yych <= 0xDF) { if (yych <= '\'') { if (yych <= 0x00) goto yy1633; if (yych <= ' ') goto yy1696; if (yych <= '"') goto yy1673; goto yy1671; } else { if (yych == '>') goto yy1647; if (yych <= 0xC1) goto yy1633; goto yy1664; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1665; if (yych == 0xED) goto yy1670; goto yy1666; } else { if (yych <= 0xF0) goto yy1667; if (yych <= 0xF3) goto yy1668; if (yych <= 0xF4) goto yy1669; goto yy1633; } } yy1662: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1662; } if (yych <= 0xE0) { if (yych <= '=') { if (yych <= 0x00) goto yy1633; if (yych <= ' ') goto yy1690; goto yy1633; } else { if (yych <= '>') goto yy1647; if (yych <= 0xC1) goto yy1633; if (yych >= 0xE0) goto yy1665; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1670; goto yy1666; } else { if (yych <= 0xF0) goto yy1667; if (yych <= 0xF3) goto yy1668; if (yych <= 0xF4) goto yy1669; goto yy1633; } } yy1664: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1662; goto yy1633; yy1665: ++p; yych = *p; if (yych <= 0x9F) goto yy1633; if (yych <= 0xBF) goto yy1664; goto yy1633; yy1666: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1664; goto yy1633; yy1667: ++p; yych = *p; if (yych <= 0x8F) goto yy1633; if (yych <= 0xBF) goto yy1666; goto yy1633; yy1668: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1666; goto yy1633; yy1669: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x8F) goto yy1666; goto yy1633; yy1670: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x9F) goto yy1664; goto yy1633; yy1671: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1671; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1633; if (yych <= '\'') goto yy1682; goto yy1633; } else { if (yych <= 0xDF) goto yy1683; if (yych <= 0xE0) goto yy1684; goto yy1685; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1689; if (yych <= 0xEF) goto yy1685; goto yy1686; } else { if (yych <= 0xF3) goto yy1687; if (yych <= 0xF4) goto yy1688; goto yy1633; } } yy1673: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1673; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy1633; if (yych <= '"') goto yy1682; goto yy1633; } else { if (yych <= 0xDF) goto yy1675; if (yych <= 0xE0) goto yy1676; goto yy1677; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1681; if (yych <= 0xEF) goto yy1677; goto yy1678; } else { if (yych <= 0xF3) goto yy1679; if (yych <= 0xF4) goto yy1680; goto yy1633; } } yy1675: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1673; goto yy1633; yy1676: ++p; yych = *p; if (yych <= 0x9F) goto yy1633; if (yych <= 0xBF) goto yy1675; goto yy1633; yy1677: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1675; goto yy1633; yy1678: ++p; yych = *p; if (yych <= 0x8F) goto yy1633; if (yych <= 0xBF) goto yy1677; goto yy1633; yy1679: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1677; goto yy1633; yy1680: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x8F) goto yy1677; goto yy1633; yy1681: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x9F) goto yy1675; goto yy1633; yy1682: ++p; yych = *p; if (yych <= ' ') { if (yych <= 0x08) goto yy1633; if (yych <= '\r') goto yy1653; if (yych <= 0x1F) goto yy1633; goto yy1653; } else { if (yych <= '/') { if (yych <= '.') goto yy1633; goto yy1655; } else { if (yych == '>') goto yy1647; goto yy1633; } } yy1683: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1671; goto yy1633; yy1684: ++p; yych = *p; if (yych <= 0x9F) goto yy1633; if (yych <= 0xBF) goto yy1683; goto yy1633; yy1685: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1683; goto yy1633; yy1686: ++p; yych = *p; if (yych <= 0x8F) goto yy1633; if (yych <= 0xBF) goto yy1685; goto yy1633; yy1687: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0xBF) goto yy1685; goto yy1633; yy1688: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x8F) goto yy1685; goto yy1633; yy1689: ++p; yych = *p; if (yych <= 0x7F) goto yy1633; if (yych <= 0x9F) goto yy1683; goto yy1633; yy1690: ++p; yych = *p; if (yych <= '@') { if (yych <= '"') { if (yych <= '\r') { if (yych <= 0x00) goto yy1633; if (yych <= 0x08) goto yy1662; goto yy1690; } else { if (yych == ' ') goto yy1690; if (yych <= '!') goto yy1662; goto yy1633; } } else { if (yych <= ':') { if (yych == '\'') goto yy1633; if (yych <= '9') goto yy1662; } else { if (yych <= ';') goto yy1662; if (yych <= '=') goto yy1633; if (yych <= '>') goto yy1647; goto yy1662; } } } else { if (yych <= 0xDF) { if (yych <= '`') { if (yych <= 'Z') goto yy1692; if (yych <= '^') goto yy1662; if (yych >= '`') goto yy1633; } else { if (yych <= 'z') goto yy1692; if (yych <= 0x7F) goto yy1662; if (yych <= 0xC1) goto yy1633; goto yy1664; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1665; if (yych == 0xED) goto yy1670; goto yy1666; } else { if (yych <= 0xF0) goto yy1667; if (yych <= 0xF3) goto yy1668; if (yych <= 0xF4) goto yy1669; goto yy1633; } } } yy1692: ++p; yych = *p; if (yych <= '>') { if (yych <= '&') { if (yych <= 0x1F) { if (yych <= 0x00) goto yy1633; if (yych <= 0x08) goto yy1662; if (yych >= 0x0E) goto yy1662; } else { if (yych <= ' ') goto yy1694; if (yych == '"') goto yy1633; goto yy1662; } } else { if (yych <= '/') { if (yych <= '\'') goto yy1633; if (yych <= ',') goto yy1662; if (yych <= '.') goto yy1692; goto yy1662; } else { if (yych <= ';') { if (yych <= ':') goto yy1692; goto yy1662; } else { if (yych <= '<') goto yy1633; if (yych <= '=') goto yy1660; goto yy1647; } } } } else { if (yych <= 0xC1) { if (yych <= '_') { if (yych <= '@') goto yy1662; if (yych <= 'Z') goto yy1692; if (yych <= '^') goto yy1662; goto yy1692; } else { if (yych <= '`') goto yy1633; if (yych <= 'z') goto yy1692; if (yych <= 0x7F) goto yy1662; goto yy1633; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1664; if (yych <= 0xE0) goto yy1665; if (yych <= 0xEC) goto yy1666; goto yy1670; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1666; goto yy1667; } else { if (yych <= 0xF3) goto yy1668; if (yych <= 0xF4) goto yy1669; goto yy1633; } } } } yy1694: ++p; yych = *p; if (yych <= '@') { if (yych <= '&') { if (yych <= 0x1F) { if (yych <= 0x00) goto yy1633; if (yych <= 0x08) goto yy1662; if (yych <= '\r') goto yy1694; goto yy1662; } else { if (yych <= ' ') goto yy1694; if (yych == '"') goto yy1633; goto yy1662; } } else { if (yych <= ';') { if (yych <= '\'') goto yy1633; if (yych == ':') goto yy1692; goto yy1662; } else { if (yych <= '<') goto yy1633; if (yych <= '=') goto yy1660; if (yych <= '>') goto yy1647; goto yy1662; } } } else { if (yych <= 0xDF) { if (yych <= '`') { if (yych <= 'Z') goto yy1692; if (yych <= '^') goto yy1662; if (yych <= '_') goto yy1692; goto yy1633; } else { if (yych <= 'z') goto yy1692; if (yych <= 0x7F) goto yy1662; if (yych <= 0xC1) goto yy1633; goto yy1664; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1665; if (yych == 0xED) goto yy1670; goto yy1666; } else { if (yych <= 0xF0) goto yy1667; if (yych <= 0xF3) goto yy1668; if (yych <= 0xF4) goto yy1669; goto yy1633; } } } yy1696: ++p; yych = *p; if (yych <= '@') { if (yych <= '"') { if (yych <= '\r') { if (yych <= 0x00) goto yy1633; if (yych <= 0x08) goto yy1662; goto yy1696; } else { if (yych == ' ') goto yy1696; if (yych <= '!') goto yy1662; goto yy1673; } } else { if (yych <= ':') { if (yych == '\'') goto yy1671; if (yych <= '9') goto yy1662; goto yy1692; } else { if (yych <= ';') goto yy1662; if (yych <= '=') goto yy1633; if (yych <= '>') goto yy1647; goto yy1662; } } } else { if (yych <= 0xDF) { if (yych <= '`') { if (yych <= 'Z') goto yy1692; if (yych <= '^') goto yy1662; if (yych <= '_') goto yy1692; goto yy1633; } else { if (yych <= 'z') goto yy1692; if (yych <= 0x7F) goto yy1662; if (yych <= 0xC1) goto yy1633; goto yy1664; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1665; if (yych == 0xED) goto yy1670; goto yy1666; } else { if (yych <= 0xF0) goto yy1667; if (yych <= 0xF3) goto yy1668; if (yych <= 0xF4) goto yy1669; goto yy1633; } } } } } // Try to match an HTML block end line of type 1 bufsize_t _scan_html_block_end_1(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 64, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= ';') { if (yych != '\n') goto yy1701; } else { if (yych <= '<') goto yy1702; if (yych <= 0x7F) goto yy1701; if (yych >= 0xC2) goto yy1703; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1705; if (yych == 0xED) goto yy1710; goto yy1706; } else { if (yych <= 0xF0) goto yy1707; if (yych <= 0xF3) goto yy1708; if (yych <= 0xF4) goto yy1709; } } yy1700 : { return 0; } yy1701: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x7F) { if (yych == '\n') goto yy1700; goto yy1715; } else { if (yych <= 0xC1) goto yy1700; if (yych <= 0xF4) goto yy1715; goto yy1700; } yy1702: yyaccept = 0; yych = *(marker = ++p); if (yych <= '/') { if (yych == '\n') goto yy1700; if (yych <= '.') goto yy1715; goto yy1711; } else { if (yych <= 0x7F) goto yy1715; if (yych <= 0xC1) goto yy1700; if (yych <= 0xF4) goto yy1715; goto yy1700; } yy1703: yych = *++p; if (yych <= 0x7F) goto yy1704; if (yych <= 0xBF) goto yy1701; yy1704: p = marker; if (yyaccept == 0) { goto yy1700; } else { goto yy1732; } yy1705: yych = *++p; if (yych <= 0x9F) goto yy1704; if (yych <= 0xBF) goto yy1703; goto yy1704; yy1706: yych = *++p; if (yych <= 0x7F) goto yy1704; if (yych <= 0xBF) goto yy1703; goto yy1704; yy1707: yych = *++p; if (yych <= 0x8F) goto yy1704; if (yych <= 0xBF) goto yy1706; goto yy1704; yy1708: yych = *++p; if (yych <= 0x7F) goto yy1704; if (yych <= 0xBF) goto yy1706; goto yy1704; yy1709: yych = *++p; if (yych <= 0x7F) goto yy1704; if (yych <= 0x8F) goto yy1706; goto yy1704; yy1710: yych = *++p; if (yych <= 0x7F) goto yy1704; if (yych <= 0x9F) goto yy1703; goto yy1704; yy1711: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 's') { if (yych <= 'R') { if (yych <= '\n') { if (yych <= '\t') goto yy1714; goto yy1704; } else { if (yych == 'P') goto yy1723; goto yy1714; } } else { if (yych <= 'o') { if (yych <= 'S') goto yy1724; goto yy1714; } else { if (yych <= 'p') goto yy1723; if (yych <= 'r') goto yy1714; goto yy1724; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x7F) goto yy1714; goto yy1704; } else { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; goto yy1718; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1722; if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1712: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xDF) { if (yych <= '.') { if (yych == '\n') goto yy1704; } else { if (yych <= '/') goto yy1711; if (yych <= 0x7F) goto yy1714; if (yych <= 0xC1) goto yy1704; goto yy1716; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1717; if (yych == 0xED) goto yy1722; goto yy1718; } else { if (yych <= 0xF0) goto yy1719; if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } yy1714: ++p; yych = *p; yy1715: if (yybm[0 + yych] & 128) { goto yy1714; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1704; if (yych <= '<') goto yy1712; goto yy1704; } else { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; goto yy1718; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1722; if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } yy1716: ++p; yych = *p; if (yych <= 0x7F) goto yy1704; if (yych <= 0xBF) goto yy1714; goto yy1704; yy1717: ++p; yych = *p; if (yych <= 0x9F) goto yy1704; if (yych <= 0xBF) goto yy1716; goto yy1704; yy1718: ++p; yych = *p; if (yych <= 0x7F) goto yy1704; if (yych <= 0xBF) goto yy1716; goto yy1704; yy1719: ++p; yych = *p; if (yych <= 0x8F) goto yy1704; if (yych <= 0xBF) goto yy1718; goto yy1704; yy1720: ++p; yych = *p; if (yych <= 0x7F) goto yy1704; if (yych <= 0xBF) goto yy1718; goto yy1704; yy1721: ++p; yych = *p; if (yych <= 0x7F) goto yy1704; if (yych <= 0x8F) goto yy1718; goto yy1704; yy1722: ++p; yych = *p; if (yych <= 0x7F) goto yy1704; if (yych <= 0x9F) goto yy1716; goto yy1704; yy1723: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'R') { if (yych == '\n') goto yy1704; if (yych <= 'Q') goto yy1714; goto yy1735; } else { if (yych == 'r') goto yy1735; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1724: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 't') { if (yych <= 'S') { if (yych <= '\n') { if (yych <= '\t') goto yy1714; goto yy1704; } else { if (yych == 'C') goto yy1726; goto yy1714; } } else { if (yych <= 'b') { if (yych >= 'U') goto yy1714; } else { if (yych <= 'c') goto yy1726; if (yych <= 's') goto yy1714; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x7F) goto yy1714; goto yy1704; } else { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; goto yy1718; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1722; if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'Y') { if (yych == '\n') goto yy1704; if (yych <= 'X') goto yy1714; goto yy1733; } else { if (yych == 'y') goto yy1733; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1726: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'R') { if (yych == '\n') goto yy1704; if (yych <= 'Q') goto yy1714; } else { if (yych == 'r') goto yy1727; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1727: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'I') { if (yych == '\n') goto yy1704; if (yych <= 'H') goto yy1714; } else { if (yych == 'i') goto yy1728; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1728: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'P') { if (yych == '\n') goto yy1704; if (yych <= 'O') goto yy1714; } else { if (yych == 'p') goto yy1729; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1729: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'T') { if (yych == '\n') goto yy1704; if (yych <= 'S') goto yy1714; } else { if (yych == 't') goto yy1730; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1730: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xDF) { if (yych <= '=') { if (yych == '\n') goto yy1704; goto yy1714; } else { if (yych <= '>') goto yy1731; if (yych <= 0x7F) goto yy1714; if (yych <= 0xC1) goto yy1704; goto yy1716; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1717; if (yych == 0xED) goto yy1722; goto yy1718; } else { if (yych <= 0xF0) goto yy1719; if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } yy1731: yyaccept = 1; marker = ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1714; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1732; if (yych <= '<') goto yy1712; } else { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; goto yy1718; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1722; if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; } } yy1732 : { return (bufsize_t)(p - start); } yy1733: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'L') { if (yych == '\n') goto yy1704; if (yych <= 'K') goto yy1714; } else { if (yych == 'l') goto yy1734; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1734: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'E') { if (yych == '\n') goto yy1704; if (yych <= 'D') goto yy1714; goto yy1730; } else { if (yych == 'e') goto yy1730; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } yy1735: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1712; } if (yych <= 0xC1) { if (yych <= 'E') { if (yych == '\n') goto yy1704; if (yych <= 'D') goto yy1714; goto yy1730; } else { if (yych == 'e') goto yy1730; if (yych <= 0x7F) goto yy1714; goto yy1704; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1716; if (yych <= 0xE0) goto yy1717; if (yych <= 0xEC) goto yy1718; goto yy1722; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1718; goto yy1719; } else { if (yych <= 0xF3) goto yy1720; if (yych <= 0xF4) goto yy1721; goto yy1704; } } } } } // Try to match an HTML block end line of type 2 bufsize_t _scan_html_block_end_2(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 64, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= ',') { if (yych != '\n') goto yy1739; } else { if (yych <= '-') goto yy1740; if (yych <= 0x7F) goto yy1739; if (yych >= 0xC2) goto yy1741; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1743; if (yych == 0xED) goto yy1748; goto yy1744; } else { if (yych <= 0xF0) goto yy1745; if (yych <= 0xF3) goto yy1746; if (yych <= 0xF4) goto yy1747; } } yy1738 : { return 0; } yy1739: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x7F) { if (yych == '\n') goto yy1738; goto yy1752; } else { if (yych <= 0xC1) goto yy1738; if (yych <= 0xF4) goto yy1752; goto yy1738; } yy1740: yyaccept = 0; yych = *(marker = ++p); if (yybm[0 + yych] & 64) { goto yy1749; } if (yych <= 0x7F) { if (yych == '\n') goto yy1738; goto yy1752; } else { if (yych <= 0xC1) goto yy1738; if (yych <= 0xF4) goto yy1752; goto yy1738; } yy1741: yych = *++p; if (yych <= 0x7F) goto yy1742; if (yych <= 0xBF) goto yy1739; yy1742: p = marker; if (yyaccept == 0) { goto yy1738; } else { goto yy1762; } yy1743: yych = *++p; if (yych <= 0x9F) goto yy1742; if (yych <= 0xBF) goto yy1741; goto yy1742; yy1744: yych = *++p; if (yych <= 0x7F) goto yy1742; if (yych <= 0xBF) goto yy1741; goto yy1742; yy1745: yych = *++p; if (yych <= 0x8F) goto yy1742; if (yych <= 0xBF) goto yy1744; goto yy1742; yy1746: yych = *++p; if (yych <= 0x7F) goto yy1742; if (yych <= 0xBF) goto yy1744; goto yy1742; yy1747: yych = *++p; if (yych <= 0x7F) goto yy1742; if (yych <= 0x8F) goto yy1744; goto yy1742; yy1748: yych = *++p; if (yych <= 0x7F) goto yy1742; if (yych <= 0x9F) goto yy1741; goto yy1742; yy1749: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1749; } if (yych <= 0xDF) { if (yych <= '=') { if (yych == '\n') goto yy1742; } else { if (yych <= '>') goto yy1761; if (yych <= 0x7F) goto yy1751; if (yych <= 0xC1) goto yy1742; goto yy1753; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1754; if (yych == 0xED) goto yy1759; goto yy1755; } else { if (yych <= 0xF0) goto yy1756; if (yych <= 0xF3) goto yy1757; if (yych <= 0xF4) goto yy1758; goto yy1742; } } yy1751: ++p; yych = *p; yy1752: if (yybm[0 + yych] & 128) { goto yy1751; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1742; if (yych <= '-') goto yy1760; goto yy1742; } else { if (yych <= 0xDF) goto yy1753; if (yych <= 0xE0) goto yy1754; goto yy1755; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1759; if (yych <= 0xEF) goto yy1755; goto yy1756; } else { if (yych <= 0xF3) goto yy1757; if (yych <= 0xF4) goto yy1758; goto yy1742; } } yy1753: ++p; yych = *p; if (yych <= 0x7F) goto yy1742; if (yych <= 0xBF) goto yy1751; goto yy1742; yy1754: ++p; yych = *p; if (yych <= 0x9F) goto yy1742; if (yych <= 0xBF) goto yy1753; goto yy1742; yy1755: ++p; yych = *p; if (yych <= 0x7F) goto yy1742; if (yych <= 0xBF) goto yy1753; goto yy1742; yy1756: ++p; yych = *p; if (yych <= 0x8F) goto yy1742; if (yych <= 0xBF) goto yy1755; goto yy1742; yy1757: ++p; yych = *p; if (yych <= 0x7F) goto yy1742; if (yych <= 0xBF) goto yy1755; goto yy1742; yy1758: ++p; yych = *p; if (yych <= 0x7F) goto yy1742; if (yych <= 0x8F) goto yy1755; goto yy1742; yy1759: ++p; yych = *p; if (yych <= 0x7F) goto yy1742; if (yych <= 0x9F) goto yy1753; goto yy1742; yy1760: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1751; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1742; if (yych <= '-') goto yy1749; goto yy1742; } else { if (yych <= 0xDF) goto yy1753; if (yych <= 0xE0) goto yy1754; goto yy1755; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1759; if (yych <= 0xEF) goto yy1755; goto yy1756; } else { if (yych <= 0xF3) goto yy1757; if (yych <= 0xF4) goto yy1758; goto yy1742; } } yy1761: yyaccept = 1; marker = ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1751; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1762; if (yych <= '-') goto yy1760; } else { if (yych <= 0xDF) goto yy1753; if (yych <= 0xE0) goto yy1754; goto yy1755; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1759; if (yych <= 0xEF) goto yy1755; goto yy1756; } else { if (yych <= 0xF3) goto yy1757; if (yych <= 0xF4) goto yy1758; } } yy1762 : { return (bufsize_t)(p - start); } } } // Try to match an HTML block end line of type 3 bufsize_t _scan_html_block_end_3(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 64, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= '>') { if (yych != '\n') goto yy1766; } else { if (yych <= '?') goto yy1767; if (yych <= 0x7F) goto yy1766; if (yych >= 0xC2) goto yy1768; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1770; if (yych == 0xED) goto yy1775; goto yy1771; } else { if (yych <= 0xF0) goto yy1772; if (yych <= 0xF3) goto yy1773; if (yych <= 0xF4) goto yy1774; } } yy1765 : { return 0; } yy1766: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x7F) { if (yych == '\n') goto yy1765; goto yy1781; } else { if (yych <= 0xC1) goto yy1765; if (yych <= 0xF4) goto yy1781; goto yy1765; } yy1767: yyaccept = 0; yych = *(marker = ++p); if (yych <= '>') { if (yych == '\n') goto yy1765; if (yych <= '=') goto yy1781; goto yy1776; } else { if (yych <= 0x7F) goto yy1781; if (yych <= 0xC1) goto yy1765; if (yych <= 0xF4) goto yy1781; goto yy1765; } yy1768: yych = *++p; if (yych <= 0x7F) goto yy1769; if (yych <= 0xBF) goto yy1766; yy1769: p = marker; if (yyaccept == 0) { goto yy1765; } else { goto yy1777; } yy1770: yych = *++p; if (yych <= 0x9F) goto yy1769; if (yych <= 0xBF) goto yy1768; goto yy1769; yy1771: yych = *++p; if (yych <= 0x7F) goto yy1769; if (yych <= 0xBF) goto yy1768; goto yy1769; yy1772: yych = *++p; if (yych <= 0x8F) goto yy1769; if (yych <= 0xBF) goto yy1771; goto yy1769; yy1773: yych = *++p; if (yych <= 0x7F) goto yy1769; if (yych <= 0xBF) goto yy1771; goto yy1769; yy1774: yych = *++p; if (yych <= 0x7F) goto yy1769; if (yych <= 0x8F) goto yy1771; goto yy1769; yy1775: yych = *++p; if (yych <= 0x7F) goto yy1769; if (yych <= 0x9F) goto yy1768; goto yy1769; yy1776: yyaccept = 1; marker = ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1780; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1777; if (yych <= '?') goto yy1778; } else { if (yych <= 0xDF) goto yy1782; if (yych <= 0xE0) goto yy1783; goto yy1784; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1788; if (yych <= 0xEF) goto yy1784; goto yy1785; } else { if (yych <= 0xF3) goto yy1786; if (yych <= 0xF4) goto yy1787; } } yy1777 : { return (bufsize_t)(p - start); } yy1778: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1778; } if (yych <= 0xDF) { if (yych <= '=') { if (yych == '\n') goto yy1769; } else { if (yych <= '>') goto yy1776; if (yych <= 0x7F) goto yy1780; if (yych <= 0xC1) goto yy1769; goto yy1782; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1783; if (yych == 0xED) goto yy1788; goto yy1784; } else { if (yych <= 0xF0) goto yy1785; if (yych <= 0xF3) goto yy1786; if (yych <= 0xF4) goto yy1787; goto yy1769; } } yy1780: ++p; yych = *p; yy1781: if (yybm[0 + yych] & 128) { goto yy1780; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1769; if (yych <= '?') goto yy1778; goto yy1769; } else { if (yych <= 0xDF) goto yy1782; if (yych <= 0xE0) goto yy1783; goto yy1784; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1788; if (yych <= 0xEF) goto yy1784; goto yy1785; } else { if (yych <= 0xF3) goto yy1786; if (yych <= 0xF4) goto yy1787; goto yy1769; } } yy1782: ++p; yych = *p; if (yych <= 0x7F) goto yy1769; if (yych <= 0xBF) goto yy1780; goto yy1769; yy1783: ++p; yych = *p; if (yych <= 0x9F) goto yy1769; if (yych <= 0xBF) goto yy1782; goto yy1769; yy1784: ++p; yych = *p; if (yych <= 0x7F) goto yy1769; if (yych <= 0xBF) goto yy1782; goto yy1769; yy1785: ++p; yych = *p; if (yych <= 0x8F) goto yy1769; if (yych <= 0xBF) goto yy1784; goto yy1769; yy1786: ++p; yych = *p; if (yych <= 0x7F) goto yy1769; if (yych <= 0xBF) goto yy1784; goto yy1769; yy1787: ++p; yych = *p; if (yych <= 0x7F) goto yy1769; if (yych <= 0x8F) goto yy1784; goto yy1769; yy1788: ++p; yych = *p; if (yych <= 0x7F) goto yy1769; if (yych <= 0x9F) goto yy1782; goto yy1769; } } // Try to match an HTML block end line of type 4 bufsize_t _scan_html_block_end_4(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 64, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= '=') { if (yych != '\n') goto yy1792; } else { if (yych <= '>') goto yy1793; if (yych <= 0x7F) goto yy1792; if (yych >= 0xC2) goto yy1795; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1797; if (yych == 0xED) goto yy1802; goto yy1798; } else { if (yych <= 0xF0) goto yy1799; if (yych <= 0xF3) goto yy1800; if (yych <= 0xF4) goto yy1801; } } yy1791 : { return 0; } yy1792: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x7F) { if (yych == '\n') goto yy1791; goto yy1806; } else { if (yych <= 0xC1) goto yy1791; if (yych <= 0xF4) goto yy1806; goto yy1791; } yy1793: yyaccept = 1; yych = *(marker = ++p); if (yych <= 0x7F) { if (yych != '\n') goto yy1806; } else { if (yych <= 0xC1) goto yy1794; if (yych <= 0xF4) goto yy1806; } yy1794 : { return (bufsize_t)(p - start); } yy1795: yych = *++p; if (yych <= 0x7F) goto yy1796; if (yych <= 0xBF) goto yy1792; yy1796: p = marker; if (yyaccept == 0) { goto yy1791; } else { goto yy1794; } yy1797: yych = *++p; if (yych <= 0x9F) goto yy1796; if (yych <= 0xBF) goto yy1795; goto yy1796; yy1798: yych = *++p; if (yych <= 0x7F) goto yy1796; if (yych <= 0xBF) goto yy1795; goto yy1796; yy1799: yych = *++p; if (yych <= 0x8F) goto yy1796; if (yych <= 0xBF) goto yy1798; goto yy1796; yy1800: yych = *++p; if (yych <= 0x7F) goto yy1796; if (yych <= 0xBF) goto yy1798; goto yy1796; yy1801: yych = *++p; if (yych <= 0x7F) goto yy1796; if (yych <= 0x8F) goto yy1798; goto yy1796; yy1802: yych = *++p; if (yych <= 0x7F) goto yy1796; if (yych <= 0x9F) goto yy1795; goto yy1796; yy1803: yyaccept = 1; marker = ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1805; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1794; if (yych <= '>') goto yy1803; goto yy1794; } else { if (yych <= 0xDF) goto yy1807; if (yych <= 0xE0) goto yy1808; goto yy1809; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1813; if (yych <= 0xEF) goto yy1809; goto yy1810; } else { if (yych <= 0xF3) goto yy1811; if (yych <= 0xF4) goto yy1812; goto yy1794; } } yy1805: ++p; yych = *p; yy1806: if (yybm[0 + yych] & 128) { goto yy1805; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1796; if (yych <= '>') goto yy1803; goto yy1796; } else { if (yych <= 0xDF) goto yy1807; if (yych <= 0xE0) goto yy1808; goto yy1809; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1813; if (yych <= 0xEF) goto yy1809; goto yy1810; } else { if (yych <= 0xF3) goto yy1811; if (yych <= 0xF4) goto yy1812; goto yy1796; } } yy1807: ++p; yych = *p; if (yych <= 0x7F) goto yy1796; if (yych <= 0xBF) goto yy1805; goto yy1796; yy1808: ++p; yych = *p; if (yych <= 0x9F) goto yy1796; if (yych <= 0xBF) goto yy1807; goto yy1796; yy1809: ++p; yych = *p; if (yych <= 0x7F) goto yy1796; if (yych <= 0xBF) goto yy1807; goto yy1796; yy1810: ++p; yych = *p; if (yych <= 0x8F) goto yy1796; if (yych <= 0xBF) goto yy1809; goto yy1796; yy1811: ++p; yych = *p; if (yych <= 0x7F) goto yy1796; if (yych <= 0xBF) goto yy1809; goto yy1796; yy1812: ++p; yych = *p; if (yych <= 0x7F) goto yy1796; if (yych <= 0x8F) goto yy1809; goto yy1796; yy1813: ++p; yych = *p; if (yych <= 0x7F) goto yy1796; if (yych <= 0x9F) goto yy1807; goto yy1796; } } // Try to match an HTML block end line of type 5 bufsize_t _scan_html_block_end_5(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 64, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= '\\') { if (yych != '\n') goto yy1817; } else { if (yych <= ']') goto yy1818; if (yych <= 0x7F) goto yy1817; if (yych >= 0xC2) goto yy1819; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1821; if (yych == 0xED) goto yy1826; goto yy1822; } else { if (yych <= 0xF0) goto yy1823; if (yych <= 0xF3) goto yy1824; if (yych <= 0xF4) goto yy1825; } } yy1816 : { return 0; } yy1817: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x7F) { if (yych == '\n') goto yy1816; goto yy1830; } else { if (yych <= 0xC1) goto yy1816; if (yych <= 0xF4) goto yy1830; goto yy1816; } yy1818: yyaccept = 0; yych = *(marker = ++p); if (yybm[0 + yych] & 64) { goto yy1827; } if (yych <= 0x7F) { if (yych == '\n') goto yy1816; goto yy1830; } else { if (yych <= 0xC1) goto yy1816; if (yych <= 0xF4) goto yy1830; goto yy1816; } yy1819: yych = *++p; if (yych <= 0x7F) goto yy1820; if (yych <= 0xBF) goto yy1817; yy1820: p = marker; if (yyaccept == 0) { goto yy1816; } else { goto yy1840; } yy1821: yych = *++p; if (yych <= 0x9F) goto yy1820; if (yych <= 0xBF) goto yy1819; goto yy1820; yy1822: yych = *++p; if (yych <= 0x7F) goto yy1820; if (yych <= 0xBF) goto yy1819; goto yy1820; yy1823: yych = *++p; if (yych <= 0x8F) goto yy1820; if (yych <= 0xBF) goto yy1822; goto yy1820; yy1824: yych = *++p; if (yych <= 0x7F) goto yy1820; if (yych <= 0xBF) goto yy1822; goto yy1820; yy1825: yych = *++p; if (yych <= 0x7F) goto yy1820; if (yych <= 0x8F) goto yy1822; goto yy1820; yy1826: yych = *++p; if (yych <= 0x7F) goto yy1820; if (yych <= 0x9F) goto yy1819; goto yy1820; yy1827: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1827; } if (yych <= 0xDF) { if (yych <= '=') { if (yych == '\n') goto yy1820; } else { if (yych <= '>') goto yy1839; if (yych <= 0x7F) goto yy1829; if (yych <= 0xC1) goto yy1820; goto yy1831; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1832; if (yych == 0xED) goto yy1837; goto yy1833; } else { if (yych <= 0xF0) goto yy1834; if (yych <= 0xF3) goto yy1835; if (yych <= 0xF4) goto yy1836; goto yy1820; } } yy1829: ++p; yych = *p; yy1830: if (yybm[0 + yych] & 128) { goto yy1829; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1820; if (yych <= ']') goto yy1838; goto yy1820; } else { if (yych <= 0xDF) goto yy1831; if (yych <= 0xE0) goto yy1832; goto yy1833; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1837; if (yych <= 0xEF) goto yy1833; goto yy1834; } else { if (yych <= 0xF3) goto yy1835; if (yych <= 0xF4) goto yy1836; goto yy1820; } } yy1831: ++p; yych = *p; if (yych <= 0x7F) goto yy1820; if (yych <= 0xBF) goto yy1829; goto yy1820; yy1832: ++p; yych = *p; if (yych <= 0x9F) goto yy1820; if (yych <= 0xBF) goto yy1831; goto yy1820; yy1833: ++p; yych = *p; if (yych <= 0x7F) goto yy1820; if (yych <= 0xBF) goto yy1831; goto yy1820; yy1834: ++p; yych = *p; if (yych <= 0x8F) goto yy1820; if (yych <= 0xBF) goto yy1833; goto yy1820; yy1835: ++p; yych = *p; if (yych <= 0x7F) goto yy1820; if (yych <= 0xBF) goto yy1833; goto yy1820; yy1836: ++p; yych = *p; if (yych <= 0x7F) goto yy1820; if (yych <= 0x8F) goto yy1833; goto yy1820; yy1837: ++p; yych = *p; if (yych <= 0x7F) goto yy1820; if (yych <= 0x9F) goto yy1831; goto yy1820; yy1838: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1829; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1820; if (yych <= ']') goto yy1827; goto yy1820; } else { if (yych <= 0xDF) goto yy1831; if (yych <= 0xE0) goto yy1832; goto yy1833; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1837; if (yych <= 0xEF) goto yy1833; goto yy1834; } else { if (yych <= 0xF3) goto yy1835; if (yych <= 0xF4) goto yy1836; goto yy1820; } } yy1839: yyaccept = 1; marker = ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1829; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\n') goto yy1840; if (yych <= ']') goto yy1838; } else { if (yych <= 0xDF) goto yy1831; if (yych <= 0xE0) goto yy1832; goto yy1833; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1837; if (yych <= 0xEF) goto yy1833; goto yy1834; } else { if (yych <= 0xF3) goto yy1835; if (yych <= 0xF4) goto yy1836; } } yy1840 : { return (bufsize_t)(p - start); } } } // Try to match a URL in a link or reference, return number of chars matched. // This may optionally be contained in <..>; otherwise // whitespace and unbalanced right parentheses aren't allowed. // Newlines aren't ever allowed. bufsize_t _scan_link_url(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 0, 128, 128, 128, 128, 128, 128, 128, 128, 128, 8, 128, 128, 8, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 136, 224, 224, 224, 224, 224, 224, 224, 128, 128, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 32, 224, 32, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 16, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= '[') { if (yych <= ' ') { if (yych <= '\f') { if (yych == '\n') goto yy1844; goto yy1860; } else { if (yych <= '\r') goto yy1846; if (yych <= 0x1F) goto yy1860; goto yy1846; } } else { if (yych <= ')') { if (yych <= '\'') goto yy1848; if (yych <= '(') goto yy1859; goto yy1860; } else { if (yych == '<') goto yy1847; goto yy1848; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\\') goto yy1857; if (yych <= 0x7F) goto yy1848; } else { if (yych <= 0xDF) goto yy1849; if (yych <= 0xE0) goto yy1851; goto yy1852; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1856; if (yych <= 0xEF) goto yy1852; goto yy1853; } else { if (yych <= 0xF3) goto yy1854; if (yych <= 0xF4) goto yy1855; } } } yy1843 : { return (bufsize_t)(p - start); } yy1844: yyaccept = 0; marker = ++p; yych = *p; yy1845: if (yybm[0 + yych] & 8) { goto yy1844; } if (yych <= 0x7F) { if (yych <= ')') { if (yych <= 0x1F) goto yy1843; if (yych <= '\'') goto yy1872; if (yych <= '(') goto yy1863; goto yy1843; } else { if (yych <= '<') { if (yych <= ';') goto yy1872; goto yy1907; } else { if (yych == '\\') goto yy1881; goto yy1872; } } } else { if (yych <= 0xED) { if (yych <= 0xDF) { if (yych <= 0xC1) goto yy1843; goto yy1874; } else { if (yych <= 0xE0) goto yy1875; if (yych <= 0xEC) goto yy1876; goto yy1880; } } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1876; goto yy1877; } else { if (yych <= 0xF3) goto yy1878; if (yych <= 0xF4) goto yy1879; goto yy1843; } } } yy1846: yyaccept = 0; yych = *(marker = ++p); goto yy1845; yy1847: yyaccept = 0; yych = *(marker = ++p); if (yybm[0 + yych] & 64) { goto yy1907; } if (yych <= '>') { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1843; goto yy1921; } else { if (yych <= '\n') goto yy1843; if (yych <= '\f') goto yy1921; goto yy1843; } } else { if (yych <= '(') { if (yych <= ' ') goto yy1921; goto yy1919; } else { if (yych <= ')') goto yy1921; if (yych <= '<') goto yy1872; goto yy1909; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\\') goto yy1918; goto yy1843; } else { if (yych <= 0xDF) goto yy1911; if (yych <= 0xE0) goto yy1912; goto yy1913; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1917; if (yych <= 0xEF) goto yy1913; goto yy1914; } else { if (yych <= 0xF3) goto yy1915; if (yych <= 0xF4) goto yy1916; goto yy1843; } } } yy1848: yyaccept = 0; yych = *(marker = ++p); goto yy1873; yy1849: yych = *++p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1848; yy1850: p = marker; if (yyaccept <= 1) { if (yyaccept == 0) { goto yy1843; } else { goto yy1858; } } else { goto yy1910; } yy1851: yych = *++p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1849; goto yy1850; yy1852: yych = *++p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1849; goto yy1850; yy1853: yych = *++p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1852; goto yy1850; yy1854: yych = *++p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1852; goto yy1850; yy1855: yych = *++p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1852; goto yy1850; yy1856: yych = *++p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1849; goto yy1850; yy1857: yyaccept = 1; yych = *(marker = ++p); if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x7F) goto yy1872; } else { if (yych <= 0xDF) goto yy1882; if (yych <= 0xE0) goto yy1883; goto yy1884; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1888; if (yych <= 0xEF) goto yy1884; goto yy1885; } else { if (yych <= 0xF3) goto yy1886; if (yych <= 0xF4) goto yy1887; } } yy1858 : { return 0; } yy1859: yyaccept = 1; yych = *(marker = ++p); if (yych <= '(') { if (yych <= ' ') goto yy1858; if (yych <= '\'') goto yy1864; goto yy1858; } else { if (yych <= 0x7F) goto yy1864; if (yych <= 0xC1) goto yy1858; if (yych <= 0xF4) goto yy1864; goto yy1858; } yy1860: yych = *++p; goto yy1858; yy1861: ++p; yych = *p; if (yybm[0 + yych] & 16) { goto yy1861; } if (yych <= 0xE0) { if (yych <= ')') { if (yych <= ' ') goto yy1850; if (yych >= ')') goto yy1889; } else { if (yych <= 0x7F) goto yy1863; if (yych <= 0xC1) goto yy1850; if (yych <= 0xDF) goto yy1865; goto yy1866; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1871; goto yy1867; } else { if (yych <= 0xF0) goto yy1868; if (yych <= 0xF3) goto yy1869; if (yych <= 0xF4) goto yy1870; goto yy1850; } } yy1863: ++p; yych = *p; yy1864: if (yybm[0 + yych] & 32) { goto yy1863; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= '(') goto yy1850; if (yych <= ')') goto yy1872; goto yy1861; } else { if (yych <= 0xC1) goto yy1850; if (yych >= 0xE0) goto yy1866; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1871; goto yy1867; } else { if (yych <= 0xF0) goto yy1868; if (yych <= 0xF3) goto yy1869; if (yych <= 0xF4) goto yy1870; goto yy1850; } } yy1865: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1863; goto yy1850; yy1866: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1865; goto yy1850; yy1867: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1865; goto yy1850; yy1868: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1867; goto yy1850; yy1869: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1867; goto yy1850; yy1870: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1867; goto yy1850; yy1871: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1865; goto yy1850; yy1872: yyaccept = 0; marker = ++p; yych = *p; yy1873: if (yych <= 0xC1) { if (yych <= ')') { if (yych <= ' ') goto yy1843; if (yych <= '\'') goto yy1872; if (yych <= '(') goto yy1863; goto yy1843; } else { if (yych == '\\') goto yy1881; if (yych <= 0x7F) goto yy1872; goto yy1843; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1874; if (yych <= 0xE0) goto yy1875; if (yych <= 0xEC) goto yy1876; goto yy1880; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1876; goto yy1877; } else { if (yych <= 0xF3) goto yy1878; if (yych <= 0xF4) goto yy1879; goto yy1843; } } } yy1874: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1872; goto yy1850; yy1875: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1874; goto yy1850; yy1876: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1874; goto yy1850; yy1877: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1876; goto yy1850; yy1878: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1876; goto yy1850; yy1879: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1876; goto yy1850; yy1880: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1874; goto yy1850; yy1881: ++p; yych = *p; if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x7F) goto yy1872; goto yy1850; } else { if (yych <= 0xDF) goto yy1882; if (yych <= 0xE0) goto yy1883; goto yy1884; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1888; if (yych <= 0xEF) goto yy1884; goto yy1885; } else { if (yych <= 0xF3) goto yy1886; if (yych <= 0xF4) goto yy1887; goto yy1850; } } yy1882: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1872; goto yy1850; yy1883: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1882; goto yy1850; yy1884: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1882; goto yy1850; yy1885: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1884; goto yy1850; yy1886: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1884; goto yy1850; yy1887: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1884; goto yy1850; yy1888: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1882; goto yy1850; yy1889: yyaccept = 0; marker = ++p; yych = *p; yy1890: if (yych <= 0xC1) { if (yych <= ')') { if (yych <= ' ') goto yy1843; if (yych <= '\'') goto yy1889; if (yych <= '(') goto yy1863; goto yy1872; } else { if (yych == '\\') goto yy1898; if (yych <= 0x7F) goto yy1889; goto yy1843; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1891; if (yych <= 0xE0) goto yy1892; if (yych <= 0xEC) goto yy1893; goto yy1897; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1893; goto yy1894; } else { if (yych <= 0xF3) goto yy1895; if (yych <= 0xF4) goto yy1896; goto yy1843; } } } yy1891: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1889; goto yy1850; yy1892: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1891; goto yy1850; yy1893: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1891; goto yy1850; yy1894: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1893; goto yy1850; yy1895: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1893; goto yy1850; yy1896: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1893; goto yy1850; yy1897: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1891; goto yy1850; yy1898: ++p; yych = *p; if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= ' ') goto yy1872; if (yych <= '[') goto yy1889; } else { if (yych <= 0x7F) goto yy1889; if (yych <= 0xC1) goto yy1850; if (yych <= 0xDF) goto yy1900; goto yy1901; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1906; goto yy1902; } else { if (yych <= 0xF0) goto yy1903; if (yych <= 0xF3) goto yy1904; if (yych <= 0xF4) goto yy1905; goto yy1850; } } yyaccept = 0; marker = ++p; yych = *p; if (yych <= 0xDF) { if (yych <= '[') { if (yych <= ' ') goto yy1843; if (yych == '(') goto yy1863; goto yy1889; } else { if (yych <= '\\') goto yy1898; if (yych <= 0x7F) goto yy1889; if (yych <= 0xC1) goto yy1843; goto yy1891; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy1892; if (yych == 0xED) goto yy1897; goto yy1893; } else { if (yych <= 0xF0) goto yy1894; if (yych <= 0xF3) goto yy1895; if (yych <= 0xF4) goto yy1896; goto yy1843; } } yy1900: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1889; goto yy1850; yy1901: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1900; goto yy1850; yy1902: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1900; goto yy1850; yy1903: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1902; goto yy1850; yy1904: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1902; goto yy1850; yy1905: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1902; goto yy1850; yy1906: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1900; goto yy1850; yy1907: yyaccept = 0; marker = ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1907; } if (yych <= '>') { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1843; goto yy1921; } else { if (yych <= '\n') goto yy1843; if (yych <= '\f') goto yy1921; goto yy1843; } } else { if (yych <= '(') { if (yych <= ' ') goto yy1921; goto yy1919; } else { if (yych <= ')') goto yy1921; if (yych <= '<') goto yy1872; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\\') goto yy1918; goto yy1843; } else { if (yych <= 0xDF) goto yy1911; if (yych <= 0xE0) goto yy1912; goto yy1913; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1917; if (yych <= 0xEF) goto yy1913; goto yy1914; } else { if (yych <= 0xF3) goto yy1915; if (yych <= 0xF4) goto yy1916; goto yy1843; } } } yy1909: yyaccept = 2; yych = *(marker = ++p); if (yych <= ')') { if (yych <= ' ') goto yy1910; if (yych <= '(') goto yy1873; } else { if (yych <= 0x7F) goto yy1873; if (yych <= 0xC1) goto yy1910; if (yych <= 0xF4) goto yy1873; } yy1910 : { return (bufsize_t)(p - start); } yy1911: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1907; goto yy1850; yy1912: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1911; goto yy1850; yy1913: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1911; goto yy1850; yy1914: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1913; goto yy1850; yy1915: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1913; goto yy1850; yy1916: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1913; goto yy1850; yy1917: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1911; goto yy1850; yy1918: ++p; yych = *p; if (yych <= 0x7F) { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1872; goto yy1907; } else { if (yych <= '\n') goto yy1872; if (yych <= '\f') goto yy1907; goto yy1872; } } else { if (yych <= '>') { if (yych <= '=') goto yy1907; goto yy1965; } else { if (yych == '\\') goto yy1966; goto yy1907; } } } else { if (yych <= 0xED) { if (yych <= 0xDF) { if (yych <= 0xC1) goto yy1850; goto yy1967; } else { if (yych <= 0xE0) goto yy1968; if (yych <= 0xEC) goto yy1969; goto yy1973; } } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1969; goto yy1970; } else { if (yych <= 0xF3) goto yy1971; if (yych <= 0xF4) goto yy1972; goto yy1850; } } } yy1919: ++p; yych = *p; if (yych <= '>') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy1850; if (yych >= '\n') goto yy1850; } else { if (yych == '\r') goto yy1850; } } else { if (yych <= ')') { if (yych <= '\'') goto yy1919; if (yych >= ')') goto yy1907; } else { if (yych == '<') goto yy1863; if (yych <= '=') goto yy1919; goto yy1934; } } } else { if (yych <= 0xE0) { if (yych <= 0x7F) { if (yych == '\\') goto yy1935; goto yy1919; } else { if (yych <= 0xC1) goto yy1850; if (yych <= 0xDF) goto yy1937; goto yy1938; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1943; goto yy1939; } else { if (yych <= 0xF0) goto yy1940; if (yych <= 0xF3) goto yy1941; if (yych <= 0xF4) goto yy1942; goto yy1850; } } } yy1921: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1921; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= '<') goto yy1850; if (yych >= '?') goto yy1924; } else { if (yych <= 0xC1) goto yy1850; if (yych <= 0xDF) goto yy1926; goto yy1927; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1932; goto yy1928; } else { if (yych <= 0xF0) goto yy1929; if (yych <= 0xF3) goto yy1930; if (yych <= 0xF4) goto yy1931; goto yy1850; } } yy1923: yych = *++p; goto yy1910; yy1924: ++p; yych = *p; if (yych <= 0x7F) { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1850; goto yy1921; } else { if (yych <= '\n') goto yy1850; if (yych <= '\f') goto yy1921; goto yy1850; } } else { if (yych <= '>') { if (yych <= '=') goto yy1921; goto yy1933; } else { if (yych == '\\') goto yy1924; goto yy1921; } } } else { if (yych <= 0xED) { if (yych <= 0xDF) { if (yych <= 0xC1) goto yy1850; } else { if (yych <= 0xE0) goto yy1927; if (yych <= 0xEC) goto yy1928; goto yy1932; } } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1928; goto yy1929; } else { if (yych <= 0xF3) goto yy1930; if (yych <= 0xF4) goto yy1931; goto yy1850; } } } yy1926: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1921; goto yy1850; yy1927: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1926; goto yy1850; yy1928: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1926; goto yy1850; yy1929: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1928; goto yy1850; yy1930: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1928; goto yy1850; yy1931: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1928; goto yy1850; yy1932: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1926; goto yy1850; yy1933: yyaccept = 2; marker = ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy1921; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= '<') goto yy1910; if (yych <= '>') goto yy1923; goto yy1924; } else { if (yych <= 0xC1) goto yy1910; if (yych <= 0xDF) goto yy1926; goto yy1927; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1932; goto yy1928; } else { if (yych <= 0xF0) goto yy1929; if (yych <= 0xF3) goto yy1930; if (yych <= 0xF4) goto yy1931; goto yy1910; } } yy1934: yyaccept = 2; yych = *(marker = ++p); if (yych <= '(') { if (yych <= ' ') goto yy1910; if (yych <= '\'') goto yy1864; goto yy1910; } else { if (yych <= 0x7F) goto yy1864; if (yych <= 0xC1) goto yy1910; if (yych <= 0xF4) goto yy1864; goto yy1910; } yy1935: ++p; yych = *p; if (yych <= '[') { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1850; goto yy1921; } else { if (yych <= '\n') goto yy1850; if (yych <= '\f') goto yy1921; goto yy1850; } } else { if (yych <= ')') { if (yych <= ' ') goto yy1921; if (yych <= '(') goto yy1919; goto yy1944; } else { if (yych == '>') goto yy1946; goto yy1919; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\\') goto yy1935; if (yych <= 0x7F) goto yy1919; goto yy1850; } else { if (yych <= 0xDF) goto yy1937; if (yych <= 0xE0) goto yy1938; goto yy1939; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1943; if (yych <= 0xEF) goto yy1939; goto yy1940; } else { if (yych <= 0xF3) goto yy1941; if (yych <= 0xF4) goto yy1942; goto yy1850; } } } yy1937: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1919; goto yy1850; yy1938: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1937; goto yy1850; yy1939: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1937; goto yy1850; yy1940: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1939; goto yy1850; yy1941: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1939; goto yy1850; yy1942: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1939; goto yy1850; yy1943: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1937; goto yy1850; yy1944: yyaccept = 0; marker = ++p; yych = *p; if (yych <= '>') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy1843; if (yych <= '\t') goto yy1921; goto yy1843; } else { if (yych == '\r') goto yy1843; goto yy1921; } } else { if (yych <= ')') { if (yych <= '\'') goto yy1944; if (yych <= '(') goto yy1919; goto yy1907; } else { if (yych == '<') goto yy1889; if (yych <= '=') goto yy1944; goto yy1947; } } } else { if (yych <= 0xE0) { if (yych <= 0x7F) { if (yych == '\\') goto yy1948; goto yy1944; } else { if (yych <= 0xC1) goto yy1843; if (yych <= 0xDF) goto yy1949; goto yy1950; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1955; goto yy1951; } else { if (yych <= 0xF0) goto yy1952; if (yych <= 0xF3) goto yy1953; if (yych <= 0xF4) goto yy1954; goto yy1843; } } } yy1946: yyaccept = 2; marker = ++p; yych = *p; if (yych <= '>') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy1910; if (yych <= '\t') goto yy1921; goto yy1910; } else { if (yych == '\r') goto yy1910; goto yy1921; } } else { if (yych <= ')') { if (yych <= '\'') goto yy1919; if (yych <= '(') goto yy1921; goto yy1907; } else { if (yych == '<') goto yy1863; if (yych <= '=') goto yy1919; goto yy1934; } } } else { if (yych <= 0xE0) { if (yych <= 0x7F) { if (yych == '\\') goto yy1935; goto yy1919; } else { if (yych <= 0xC1) goto yy1910; if (yych <= 0xDF) goto yy1937; goto yy1938; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1943; goto yy1939; } else { if (yych <= 0xF0) goto yy1940; if (yych <= 0xF3) goto yy1941; if (yych <= 0xF4) goto yy1942; goto yy1910; } } } yy1947: yyaccept = 2; yych = *(marker = ++p); if (yych <= ' ') goto yy1910; if (yych <= 0x7F) goto yy1890; if (yych <= 0xC1) goto yy1910; if (yych <= 0xF4) goto yy1890; goto yy1910; yy1948: ++p; yych = *p; if (yych <= '\\') { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1872; goto yy1907; } else { if (yych <= '\n') goto yy1872; if (yych <= '\f') goto yy1907; goto yy1872; } } else { if (yych <= '=') { if (yych <= ' ') goto yy1907; goto yy1944; } else { if (yych <= '>') goto yy1956; if (yych <= '[') goto yy1944; goto yy1957; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x7F) goto yy1944; goto yy1850; } else { if (yych <= 0xDF) goto yy1958; if (yych <= 0xE0) goto yy1959; goto yy1960; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1964; if (yych <= 0xEF) goto yy1960; goto yy1961; } else { if (yych <= 0xF3) goto yy1962; if (yych <= 0xF4) goto yy1963; goto yy1850; } } } yy1949: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1944; goto yy1850; yy1950: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1949; goto yy1850; yy1951: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1949; goto yy1850; yy1952: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1951; goto yy1850; yy1953: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1951; goto yy1850; yy1954: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1951; goto yy1850; yy1955: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1949; goto yy1850; yy1956: yyaccept = 2; marker = ++p; yych = *p; if (yych <= '>') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy1910; if (yych <= '\t') goto yy1921; goto yy1910; } else { if (yych == '\r') goto yy1910; goto yy1921; } } else { if (yych <= ')') { if (yych <= '\'') goto yy1944; if (yych <= '(') goto yy1919; goto yy1907; } else { if (yych == '<') goto yy1889; if (yych <= '=') goto yy1944; goto yy1947; } } } else { if (yych <= 0xE0) { if (yych <= 0x7F) { if (yych == '\\') goto yy1948; goto yy1944; } else { if (yych <= 0xC1) goto yy1910; if (yych <= 0xDF) goto yy1949; goto yy1950; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1955; goto yy1951; } else { if (yych <= 0xF0) goto yy1952; if (yych <= 0xF3) goto yy1953; if (yych <= 0xF4) goto yy1954; goto yy1910; } } } yy1957: yyaccept = 0; marker = ++p; yych = *p; if (yych <= '[') { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1843; goto yy1921; } else { if (yych <= '\n') goto yy1843; if (yych <= '\f') goto yy1921; goto yy1843; } } else { if (yych <= '(') { if (yych <= ' ') goto yy1921; if (yych <= '\'') goto yy1944; goto yy1919; } else { if (yych == '>') goto yy1956; goto yy1944; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\\') goto yy1948; if (yych <= 0x7F) goto yy1944; goto yy1843; } else { if (yych <= 0xDF) goto yy1949; if (yych <= 0xE0) goto yy1950; goto yy1951; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1955; if (yych <= 0xEF) goto yy1951; goto yy1952; } else { if (yych <= 0xF3) goto yy1953; if (yych <= 0xF4) goto yy1954; goto yy1843; } } } yy1958: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1944; goto yy1850; yy1959: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1958; goto yy1850; yy1960: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1958; goto yy1850; yy1961: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1960; goto yy1850; yy1962: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1960; goto yy1850; yy1963: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1960; goto yy1850; yy1964: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1958; goto yy1850; yy1965: yyaccept = 2; marker = ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy1907; } if (yych <= '>') { if (yych <= '\r') { if (yych <= '\t') { if (yych <= 0x00) goto yy1910; goto yy1921; } else { if (yych <= '\n') goto yy1910; if (yych <= '\f') goto yy1921; goto yy1910; } } else { if (yych <= '(') { if (yych <= ' ') goto yy1921; goto yy1919; } else { if (yych <= ')') goto yy1921; if (yych <= '<') goto yy1872; goto yy1909; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\\') goto yy1918; goto yy1910; } else { if (yych <= 0xDF) goto yy1911; if (yych <= 0xE0) goto yy1912; goto yy1913; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1917; if (yych <= 0xEF) goto yy1913; goto yy1914; } else { if (yych <= 0xF3) goto yy1915; if (yych <= 0xF4) goto yy1916; goto yy1910; } } } yy1966: yyaccept = 0; marker = ++p; yych = *p; if (yych <= '[') { if (yych <= ' ') { if (yych <= '\n') { if (yych <= 0x00) goto yy1843; if (yych <= '\t') goto yy1921; goto yy1843; } else { if (yych == '\r') goto yy1843; goto yy1921; } } else { if (yych <= ')') { if (yych <= '\'') goto yy1907; if (yych <= '(') goto yy1919; goto yy1921; } else { if (yych == '>') goto yy1965; goto yy1907; } } } else { if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= '\\') goto yy1918; if (yych <= 0x7F) goto yy1907; goto yy1843; } else { if (yych <= 0xDF) goto yy1911; if (yych <= 0xE0) goto yy1912; goto yy1913; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy1917; if (yych <= 0xEF) goto yy1913; goto yy1914; } else { if (yych <= 0xF3) goto yy1915; if (yych <= 0xF4) goto yy1916; goto yy1843; } } } yy1967: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1907; goto yy1850; yy1968: ++p; yych = *p; if (yych <= 0x9F) goto yy1850; if (yych <= 0xBF) goto yy1967; goto yy1850; yy1969: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1967; goto yy1850; yy1970: ++p; yych = *p; if (yych <= 0x8F) goto yy1850; if (yych <= 0xBF) goto yy1969; goto yy1850; yy1971: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0xBF) goto yy1969; goto yy1850; yy1972: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x8F) goto yy1969; goto yy1850; yy1973: ++p; yych = *p; if (yych <= 0x7F) goto yy1850; if (yych <= 0x9F) goto yy1967; goto yy1850; } } // Try to match a link title (in single quotes, in double quotes, or // in parentheses), returning number of chars matched. Allow one // level of internal nesting (quotes within quotes). bufsize_t _scan_link_title(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; static const unsigned char yybm[] = { 0, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 96, 224, 224, 224, 224, 160, 224, 192, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 16, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xC1) { if (yych <= '"') { if (yych == '\n') goto yy1976; if (yych <= '!') goto yy1980; goto yy1977; } else { if (yych <= '\'') { if (yych <= '&') goto yy1980; goto yy1978; } else { if (yych <= '(') goto yy1979; if (yych <= 0x7F) goto yy1980; } } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy1981; if (yych <= 0xE0) goto yy1983; if (yych <= 0xEC) goto yy1984; goto yy1988; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy1984; goto yy1985; } else { if (yych <= 0xF3) goto yy1986; if (yych <= 0xF4) goto yy1987; } } } yy1976 : { return 0; } yy1977: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x00) goto yy1976; if (yych <= 0x7F) goto yy2020; if (yych <= 0xC1) goto yy1976; if (yych <= 0xF4) goto yy2020; goto yy1976; yy1978: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x00) goto yy1976; if (yych <= 0x7F) goto yy2006; if (yych <= 0xC1) goto yy1976; if (yych <= 0xF4) goto yy2006; goto yy1976; yy1979: yyaccept = 0; yych = *(marker = ++p); if (yych <= 0x00) goto yy1976; if (yych <= 0x7F) goto yy1992; if (yych <= 0xC1) goto yy1976; if (yych <= 0xF4) goto yy1992; goto yy1976; yy1980: yych = *++p; goto yy1976; yy1981: yych = *++p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy1980; yy1982: p = marker; if (yyaccept <= 1) { if (yyaccept == 0) { goto yy1976; } else { goto yy2001; } } else { if (yyaccept == 2) { goto yy2015; } else { goto yy2029; } } yy1983: yych = *++p; if (yych <= 0x9F) goto yy1982; if (yych <= 0xBF) goto yy1981; goto yy1982; yy1984: yych = *++p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy1981; goto yy1982; yy1985: yych = *++p; if (yych <= 0x8F) goto yy1982; if (yych <= 0xBF) goto yy1984; goto yy1982; yy1986: yych = *++p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy1984; goto yy1982; yy1987: yych = *++p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x8F) goto yy1984; goto yy1982; yy1988: yych = *++p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x9F) goto yy1981; goto yy1982; yy1989: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1991; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy1982; if (yych <= ')') goto yy2002; goto yy1989; } else { if (yych <= 0xC1) goto yy1982; if (yych <= 0xDF) goto yy1993; goto yy1994; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1999; goto yy1995; } else { if (yych <= 0xF0) goto yy1996; if (yych <= 0xF3) goto yy1997; if (yych <= 0xF4) goto yy1998; goto yy1982; } } yy1991: ++p; yych = *p; yy1992: if (yybm[0 + yych] & 32) { goto yy1991; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy1982; if (yych <= ')') goto yy2000; goto yy1989; } else { if (yych <= 0xC1) goto yy1982; if (yych >= 0xE0) goto yy1994; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1999; goto yy1995; } else { if (yych <= 0xF0) goto yy1996; if (yych <= 0xF3) goto yy1997; if (yych <= 0xF4) goto yy1998; goto yy1982; } } yy1993: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy1991; goto yy1982; yy1994: ++p; yych = *p; if (yych <= 0x9F) goto yy1982; if (yych <= 0xBF) goto yy1993; goto yy1982; yy1995: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy1993; goto yy1982; yy1996: ++p; yych = *p; if (yych <= 0x8F) goto yy1982; if (yych <= 0xBF) goto yy1995; goto yy1982; yy1997: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy1995; goto yy1982; yy1998: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x8F) goto yy1995; goto yy1982; yy1999: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x9F) goto yy1993; goto yy1982; yy2000: ++p; yy2001 : { return (bufsize_t)(p - start); } yy2002: yyaccept = 1; marker = ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy1991; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy2001; if (yych <= ')') goto yy2000; goto yy1989; } else { if (yych <= 0xC1) goto yy2001; if (yych <= 0xDF) goto yy1993; goto yy1994; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy1999; goto yy1995; } else { if (yych <= 0xF0) goto yy1996; if (yych <= 0xF3) goto yy1997; if (yych <= 0xF4) goto yy1998; goto yy2001; } } yy2003: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy2005; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy1982; if (yych <= '\'') goto yy2016; goto yy2003; } else { if (yych <= 0xC1) goto yy1982; if (yych <= 0xDF) goto yy2007; goto yy2008; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2013; goto yy2009; } else { if (yych <= 0xF0) goto yy2010; if (yych <= 0xF3) goto yy2011; if (yych <= 0xF4) goto yy2012; goto yy1982; } } yy2005: ++p; yych = *p; yy2006: if (yybm[0 + yych] & 64) { goto yy2005; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy1982; if (yych <= '\'') goto yy2014; goto yy2003; } else { if (yych <= 0xC1) goto yy1982; if (yych >= 0xE0) goto yy2008; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2013; goto yy2009; } else { if (yych <= 0xF0) goto yy2010; if (yych <= 0xF3) goto yy2011; if (yych <= 0xF4) goto yy2012; goto yy1982; } } yy2007: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy2005; goto yy1982; yy2008: ++p; yych = *p; if (yych <= 0x9F) goto yy1982; if (yych <= 0xBF) goto yy2007; goto yy1982; yy2009: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy2007; goto yy1982; yy2010: ++p; yych = *p; if (yych <= 0x8F) goto yy1982; if (yych <= 0xBF) goto yy2009; goto yy1982; yy2011: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy2009; goto yy1982; yy2012: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x8F) goto yy2009; goto yy1982; yy2013: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x9F) goto yy2007; goto yy1982; yy2014: ++p; yy2015 : { return (bufsize_t)(p - start); } yy2016: yyaccept = 2; marker = ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy2005; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy2015; if (yych <= '\'') goto yy2014; goto yy2003; } else { if (yych <= 0xC1) goto yy2015; if (yych <= 0xDF) goto yy2007; goto yy2008; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2013; goto yy2009; } else { if (yych <= 0xF0) goto yy2010; if (yych <= 0xF3) goto yy2011; if (yych <= 0xF4) goto yy2012; goto yy2015; } } yy2017: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2019; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy1982; if (yych <= '"') goto yy2030; goto yy2017; } else { if (yych <= 0xC1) goto yy1982; if (yych <= 0xDF) goto yy2021; goto yy2022; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2027; goto yy2023; } else { if (yych <= 0xF0) goto yy2024; if (yych <= 0xF3) goto yy2025; if (yych <= 0xF4) goto yy2026; goto yy1982; } } yy2019: ++p; yych = *p; yy2020: if (yybm[0 + yych] & 128) { goto yy2019; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy1982; if (yych <= '"') goto yy2028; goto yy2017; } else { if (yych <= 0xC1) goto yy1982; if (yych >= 0xE0) goto yy2022; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2027; goto yy2023; } else { if (yych <= 0xF0) goto yy2024; if (yych <= 0xF3) goto yy2025; if (yych <= 0xF4) goto yy2026; goto yy1982; } } yy2021: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy2019; goto yy1982; yy2022: ++p; yych = *p; if (yych <= 0x9F) goto yy1982; if (yych <= 0xBF) goto yy2021; goto yy1982; yy2023: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy2021; goto yy1982; yy2024: ++p; yych = *p; if (yych <= 0x8F) goto yy1982; if (yych <= 0xBF) goto yy2023; goto yy1982; yy2025: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0xBF) goto yy2023; goto yy1982; yy2026: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x8F) goto yy2023; goto yy1982; yy2027: ++p; yych = *p; if (yych <= 0x7F) goto yy1982; if (yych <= 0x9F) goto yy2021; goto yy1982; yy2028: ++p; yy2029 : { return (bufsize_t)(p - start); } yy2030: yyaccept = 3; marker = ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2019; } if (yych <= 0xE0) { if (yych <= '\\') { if (yych <= 0x00) goto yy2029; if (yych <= '"') goto yy2028; goto yy2017; } else { if (yych <= 0xC1) goto yy2029; if (yych <= 0xDF) goto yy2021; goto yy2022; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2027; goto yy2023; } else { if (yych <= 0xF0) goto yy2024; if (yych <= 0xF3) goto yy2025; if (yych <= 0xF4) goto yy2026; goto yy2029; } } } } // Match space characters, including newlines. bufsize_t _scan_spacechars(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 128, 128, 128, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xC1) { if (yych <= '\r') { if (yych <= 0x08) goto yy2037; if (yych == '\n') goto yy2035; goto yy2034; } else { if (yych == ' ') goto yy2034; if (yych <= 0x7F) goto yy2037; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy2039; if (yych <= 0xE0) goto yy2041; if (yych <= 0xEC) goto yy2042; goto yy2046; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy2042; goto yy2043; } else { if (yych <= 0xF3) goto yy2044; if (yych <= 0xF4) goto yy2045; } } } yy2033 : { return (bufsize_t)(p - start); } yy2034: yych = *++p; goto yy2036; yy2035: ++p; yych = *p; yy2036: if (yybm[0 + yych] & 128) { goto yy2035; } goto yy2033; yy2037: ++p; { return 0; } yy2039: yych = *++p; if (yych <= 0x7F) goto yy2040; if (yych <= 0xBF) goto yy2037; yy2040: p = marker; goto yy2033; yy2041: yych = *++p; if (yych <= 0x9F) goto yy2040; if (yych <= 0xBF) goto yy2039; goto yy2040; yy2042: yych = *++p; if (yych <= 0x7F) goto yy2040; if (yych <= 0xBF) goto yy2039; goto yy2040; yy2043: yych = *++p; if (yych <= 0x8F) goto yy2040; if (yych <= 0xBF) goto yy2042; goto yy2040; yy2044: yych = *++p; if (yych <= 0x7F) goto yy2040; if (yych <= 0xBF) goto yy2042; goto yy2040; yy2045: yych = *++p; if (yych <= 0x7F) goto yy2040; if (yych <= 0x8F) goto yy2042; goto yy2040; yy2046: ++p; if ((yych = *p) <= 0x7F) goto yy2040; if (yych <= 0x9F) goto yy2039; goto yy2040; } } // Match ATX header start. bufsize_t _scan_atx_header_start(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= '"') { if (yych != '\n') goto yy2051; } else { if (yych <= '#') goto yy2050; if (yych <= 0x7F) goto yy2051; if (yych >= 0xC2) goto yy2052; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy2054; if (yych == 0xED) goto yy2059; goto yy2055; } else { if (yych <= 0xF0) goto yy2056; if (yych <= 0xF3) goto yy2057; if (yych <= 0xF4) goto yy2058; } } yy2049 : { return 0; } yy2050: yych = *(marker = ++p); if (yybm[0 + yych] & 128) { goto yy2062; } if (yych <= '\f') { if (yych == '\n') goto yy2060; goto yy2049; } else { if (yych <= '\r') goto yy2060; if (yych == '#') goto yy2064; goto yy2049; } yy2051: yych = *++p; goto yy2049; yy2052: yych = *++p; if (yych <= 0x7F) goto yy2053; if (yych <= 0xBF) goto yy2051; yy2053: p = marker; goto yy2049; yy2054: yych = *++p; if (yych <= 0x9F) goto yy2053; if (yych <= 0xBF) goto yy2052; goto yy2053; yy2055: yych = *++p; if (yych <= 0x7F) goto yy2053; if (yych <= 0xBF) goto yy2052; goto yy2053; yy2056: yych = *++p; if (yych <= 0x8F) goto yy2053; if (yych <= 0xBF) goto yy2055; goto yy2053; yy2057: yych = *++p; if (yych <= 0x7F) goto yy2053; if (yych <= 0xBF) goto yy2055; goto yy2053; yy2058: yych = *++p; if (yych <= 0x7F) goto yy2053; if (yych <= 0x8F) goto yy2055; goto yy2053; yy2059: yych = *++p; if (yych <= 0x7F) goto yy2053; if (yych <= 0x9F) goto yy2052; goto yy2053; yy2060: ++p; yy2061 : { return (bufsize_t)(p - start); } yy2062: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2062; } goto yy2061; yy2064: yych = *++p; if (yybm[0 + yych] & 128) { goto yy2062; } if (yych <= '\f') { if (yych == '\n') goto yy2060; goto yy2053; } else { if (yych <= '\r') goto yy2060; if (yych != '#') goto yy2053; } yych = *++p; if (yybm[0 + yych] & 128) { goto yy2062; } if (yych <= '\f') { if (yych == '\n') goto yy2060; goto yy2053; } else { if (yych <= '\r') goto yy2060; if (yych != '#') goto yy2053; } yych = *++p; if (yybm[0 + yych] & 128) { goto yy2062; } if (yych <= '\f') { if (yych == '\n') goto yy2060; goto yy2053; } else { if (yych <= '\r') goto yy2060; if (yych != '#') goto yy2053; } yych = *++p; if (yybm[0 + yych] & 128) { goto yy2062; } if (yych <= '\f') { if (yych == '\n') goto yy2060; goto yy2053; } else { if (yych <= '\r') goto yy2060; if (yych != '#') goto yy2053; } ++p; if (yybm[0 + (yych = *p)] & 128) { goto yy2062; } if (yych == '\n') goto yy2060; if (yych == '\r') goto yy2060; goto yy2053; } } // Match setext header line. Return 1 for level-1 header, // 2 for level-2, 0 for no match. bufsize_t _scan_setext_header_line(const unsigned char *p) { const unsigned char *marker = NULL; { unsigned char yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xC1) { if (yych <= '-') { if (yych == '\n') goto yy2071; if (yych <= ',') goto yy2074; goto yy2073; } else { if (yych == '=') goto yy2072; if (yych <= 0x7F) goto yy2074; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy2075; if (yych <= 0xE0) goto yy2077; if (yych <= 0xEC) goto yy2078; goto yy2082; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy2078; goto yy2079; } else { if (yych <= 0xF3) goto yy2080; if (yych <= 0xF4) goto yy2081; } } } yy2071 : { return 0; } yy2072: yych = *(marker = ++p); if (yybm[0 + yych] & 128) { goto yy2093; } if (yych <= '\f') { if (yych == '\n') goto yy2091; goto yy2071; } else { if (yych <= '\r') goto yy2091; if (yych == ' ') goto yy2089; goto yy2071; } yy2073: yych = *(marker = ++p); if (yybm[0 + yych] & 32) { goto yy2083; } if (yych <= '\f') { if (yych == '\n') goto yy2085; goto yy2071; } else { if (yych <= '\r') goto yy2085; if (yych == '-') goto yy2087; goto yy2071; } yy2074: yych = *++p; goto yy2071; yy2075: yych = *++p; if (yych <= 0x7F) goto yy2076; if (yych <= 0xBF) goto yy2074; yy2076: p = marker; goto yy2071; yy2077: yych = *++p; if (yych <= 0x9F) goto yy2076; if (yych <= 0xBF) goto yy2075; goto yy2076; yy2078: yych = *++p; if (yych <= 0x7F) goto yy2076; if (yych <= 0xBF) goto yy2075; goto yy2076; yy2079: yych = *++p; if (yych <= 0x8F) goto yy2076; if (yych <= 0xBF) goto yy2078; goto yy2076; yy2080: yych = *++p; if (yych <= 0x7F) goto yy2076; if (yych <= 0xBF) goto yy2078; goto yy2076; yy2081: yych = *++p; if (yych <= 0x7F) goto yy2076; if (yych <= 0x8F) goto yy2078; goto yy2076; yy2082: yych = *++p; if (yych <= 0x7F) goto yy2076; if (yych <= 0x9F) goto yy2075; goto yy2076; yy2083: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy2083; } if (yych == '\n') goto yy2085; if (yych != '\r') goto yy2076; yy2085: ++p; { return 2; } yy2087: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy2083; } if (yych <= '\f') { if (yych == '\n') goto yy2085; goto yy2076; } else { if (yych <= '\r') goto yy2085; if (yych == '-') goto yy2087; goto yy2076; } yy2089: ++p; yych = *p; if (yych <= '\f') { if (yych != '\n') goto yy2076; } else { if (yych <= '\r') goto yy2091; if (yych == ' ') goto yy2089; goto yy2076; } yy2091: ++p; { return 1; } yy2093: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2093; } if (yych <= '\f') { if (yych == '\n') goto yy2091; goto yy2076; } else { if (yych <= '\r') goto yy2091; if (yych == ' ') goto yy2089; goto yy2076; } } } // Scan a horizontal rule line: "...three or more hyphens, asterisks, // or underscores on a line by themselves. If you wish, you may use // spaces between the hyphens or asterisks." bufsize_t _scan_hrule(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 16, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0x7F) { if (yych <= '*') { if (yych == '\n') goto yy2097; if (yych <= ')') goto yy2101; goto yy2098; } else { if (yych <= '-') { if (yych <= ',') goto yy2101; goto yy2100; } else { if (yych == '_') goto yy2099; goto yy2101; } } } else { if (yych <= 0xED) { if (yych <= 0xDF) { if (yych >= 0xC2) goto yy2102; } else { if (yych <= 0xE0) goto yy2104; if (yych <= 0xEC) goto yy2105; goto yy2109; } } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy2105; goto yy2106; } else { if (yych <= 0xF3) goto yy2107; if (yych <= 0xF4) goto yy2108; } } } yy2097 : { return 0; } yy2098: yych = *(marker = ++p); if (yych == ' ') goto yy2130; if (yych == '*') goto yy2132; goto yy2097; yy2099: yych = *(marker = ++p); if (yych == ' ') goto yy2120; if (yych == '_') goto yy2122; goto yy2097; yy2100: yych = *(marker = ++p); if (yybm[0 + yych] & 8) { goto yy2110; } if (yych == '-') goto yy2112; goto yy2097; yy2101: yych = *++p; goto yy2097; yy2102: yych = *++p; if (yych <= 0x7F) goto yy2103; if (yych <= 0xBF) goto yy2101; yy2103: p = marker; goto yy2097; yy2104: yych = *++p; if (yych <= 0x9F) goto yy2103; if (yych <= 0xBF) goto yy2102; goto yy2103; yy2105: yych = *++p; if (yych <= 0x7F) goto yy2103; if (yych <= 0xBF) goto yy2102; goto yy2103; yy2106: yych = *++p; if (yych <= 0x8F) goto yy2103; if (yych <= 0xBF) goto yy2105; goto yy2103; yy2107: yych = *++p; if (yych <= 0x7F) goto yy2103; if (yych <= 0xBF) goto yy2105; goto yy2103; yy2108: yych = *++p; if (yych <= 0x7F) goto yy2103; if (yych <= 0x8F) goto yy2105; goto yy2103; yy2109: yych = *++p; if (yych <= 0x7F) goto yy2103; if (yych <= 0x9F) goto yy2102; goto yy2103; yy2110: ++p; yych = *p; if (yybm[0 + yych] & 8) { goto yy2110; } if (yych != '-') goto yy2103; yy2112: ++p; yych = *p; if (yych == ' ') goto yy2112; if (yych != '-') goto yy2103; yy2114: ++p; yych = *p; if (yybm[0 + yych] & 16) { goto yy2114; } if (yych <= '\n') { if (yych <= 0x08) goto yy2103; if (yych >= '\n') goto yy2118; } else { if (yych == '\r') goto yy2118; goto yy2103; } yy2116: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy2116; } if (yych <= 0x08) goto yy2103; if (yych <= '\n') goto yy2118; if (yych != '\r') goto yy2103; yy2118: ++p; { return (bufsize_t)(p - start); } yy2120: ++p; yych = *p; if (yych == ' ') goto yy2120; if (yych != '_') goto yy2103; yy2122: ++p; yych = *p; if (yych == ' ') goto yy2122; if (yych != '_') goto yy2103; yy2124: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy2124; } if (yych <= '\n') { if (yych <= 0x08) goto yy2103; if (yych >= '\n') goto yy2128; } else { if (yych == '\r') goto yy2128; goto yy2103; } yy2126: ++p; yych = *p; if (yych <= '\f') { if (yych <= 0x08) goto yy2103; if (yych <= '\t') goto yy2126; if (yych >= '\v') goto yy2103; } else { if (yych <= '\r') goto yy2128; if (yych == ' ') goto yy2126; goto yy2103; } yy2128: ++p; { return (bufsize_t)(p - start); } yy2130: ++p; yych = *p; if (yych == ' ') goto yy2130; if (yych != '*') goto yy2103; yy2132: ++p; yych = *p; if (yych == ' ') goto yy2132; if (yych != '*') goto yy2103; yy2134: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2134; } if (yych <= '\n') { if (yych <= 0x08) goto yy2103; if (yych >= '\n') goto yy2138; } else { if (yych == '\r') goto yy2138; goto yy2103; } yy2136: ++p; yych = *p; if (yych <= '\f') { if (yych <= 0x08) goto yy2103; if (yych <= '\t') goto yy2136; if (yych >= '\v') goto yy2103; } else { if (yych <= '\r') goto yy2138; if (yych == ' ') goto yy2136; goto yy2103; } yy2138: ++p; { return (bufsize_t)(p - start); } } } // Scan an opening code fence. bufsize_t _scan_open_code_fence(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 0, 160, 160, 0, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 96, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 160, 144, 160, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xC1) { if (yych <= '`') { if (yych == '\n') goto yy2142; if (yych <= '_') goto yy2145; goto yy2143; } else { if (yych == '~') goto yy2144; if (yych <= 0x7F) goto yy2145; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy2146; if (yych <= 0xE0) goto yy2148; if (yych <= 0xEC) goto yy2149; goto yy2153; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy2149; goto yy2150; } else { if (yych <= 0xF3) goto yy2151; if (yych <= 0xF4) goto yy2152; } } } yy2142 : { return 0; } yy2143: yych = *(marker = ++p); if (yych == '`') goto yy2168; goto yy2142; yy2144: yych = *(marker = ++p); if (yych == '~') goto yy2154; goto yy2142; yy2145: yych = *++p; goto yy2142; yy2146: yych = *++p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2145; yy2147: p = marker; goto yy2142; yy2148: yych = *++p; if (yych <= 0x9F) goto yy2147; if (yych <= 0xBF) goto yy2146; goto yy2147; yy2149: yych = *++p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2146; goto yy2147; yy2150: yych = *++p; if (yych <= 0x8F) goto yy2147; if (yych <= 0xBF) goto yy2149; goto yy2147; yy2151: yych = *++p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2149; goto yy2147; yy2152: yych = *++p; if (yych <= 0x7F) goto yy2147; if (yych <= 0x8F) goto yy2149; goto yy2147; yy2153: yych = *++p; if (yych <= 0x7F) goto yy2147; if (yych <= 0x9F) goto yy2146; goto yy2147; yy2154: yych = *++p; if (yybm[0 + yych] & 16) { goto yy2155; } goto yy2147; yy2155: marker = p + 1; ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy2157; } if (yych <= 0xE0) { if (yych <= '~') { if (yych <= 0x00) goto yy2147; if (yych <= '\r') goto yy2166; goto yy2155; } else { if (yych <= 0xC1) goto yy2147; if (yych <= 0xDF) goto yy2159; goto yy2160; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2165; goto yy2161; } else { if (yych <= 0xF0) goto yy2162; if (yych <= 0xF3) goto yy2163; if (yych <= 0xF4) goto yy2164; goto yy2147; } } yy2157: ++p; yych = *p; if (yybm[0 + yych] & 32) { goto yy2157; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy2147; if (yych <= '\r') goto yy2166; goto yy2147; } else { if (yych <= 0xDF) goto yy2159; if (yych <= 0xE0) goto yy2160; goto yy2161; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy2165; if (yych <= 0xEF) goto yy2161; goto yy2162; } else { if (yych <= 0xF3) goto yy2163; if (yych <= 0xF4) goto yy2164; goto yy2147; } } yy2159: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2157; goto yy2147; yy2160: ++p; yych = *p; if (yych <= 0x9F) goto yy2147; if (yych <= 0xBF) goto yy2159; goto yy2147; yy2161: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2159; goto yy2147; yy2162: ++p; yych = *p; if (yych <= 0x8F) goto yy2147; if (yych <= 0xBF) goto yy2161; goto yy2147; yy2163: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2161; goto yy2147; yy2164: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0x8F) goto yy2161; goto yy2147; yy2165: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0x9F) goto yy2159; goto yy2147; yy2166: ++p; p = marker; { return (bufsize_t)(p - start); } yy2168: yych = *++p; if (yybm[0 + yych] & 64) { goto yy2169; } goto yy2147; yy2169: marker = p + 1; ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2171; } if (yych <= 0xE0) { if (yych <= '`') { if (yych <= 0x00) goto yy2147; if (yych <= '\r') goto yy2180; goto yy2169; } else { if (yych <= 0xC1) goto yy2147; if (yych <= 0xDF) goto yy2173; goto yy2174; } } else { if (yych <= 0xEF) { if (yych == 0xED) goto yy2179; goto yy2175; } else { if (yych <= 0xF0) goto yy2176; if (yych <= 0xF3) goto yy2177; if (yych <= 0xF4) goto yy2178; goto yy2147; } } yy2171: ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2171; } if (yych <= 0xEC) { if (yych <= 0xC1) { if (yych <= 0x00) goto yy2147; if (yych <= '\r') goto yy2180; goto yy2147; } else { if (yych <= 0xDF) goto yy2173; if (yych <= 0xE0) goto yy2174; goto yy2175; } } else { if (yych <= 0xF0) { if (yych <= 0xED) goto yy2179; if (yych <= 0xEF) goto yy2175; goto yy2176; } else { if (yych <= 0xF3) goto yy2177; if (yych <= 0xF4) goto yy2178; goto yy2147; } } yy2173: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2171; goto yy2147; yy2174: ++p; yych = *p; if (yych <= 0x9F) goto yy2147; if (yych <= 0xBF) goto yy2173; goto yy2147; yy2175: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2173; goto yy2147; yy2176: ++p; yych = *p; if (yych <= 0x8F) goto yy2147; if (yych <= 0xBF) goto yy2175; goto yy2147; yy2177: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0xBF) goto yy2175; goto yy2147; yy2178: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0x8F) goto yy2175; goto yy2147; yy2179: ++p; yych = *p; if (yych <= 0x7F) goto yy2147; if (yych <= 0x9F) goto yy2173; goto yy2147; yy2180: ++p; p = marker; { return (bufsize_t)(p - start); } } } // Scan a closing code fence with length at least len. bufsize_t _scan_close_code_fence(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; static const unsigned char yybm[] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, }; yych = *(marker = p); if (yych <= 0xC1) { if (yych <= '`') { if (yych == '\n') goto yy2184; if (yych <= '_') goto yy2187; goto yy2185; } else { if (yych == '~') goto yy2186; if (yych <= 0x7F) goto yy2187; } } else { if (yych <= 0xED) { if (yych <= 0xDF) goto yy2188; if (yych <= 0xE0) goto yy2190; if (yych <= 0xEC) goto yy2191; goto yy2195; } else { if (yych <= 0xF0) { if (yych <= 0xEF) goto yy2191; goto yy2192; } else { if (yych <= 0xF3) goto yy2193; if (yych <= 0xF4) goto yy2194; } } } yy2184 : { return 0; } yy2185: yych = *(marker = ++p); if (yych == '`') goto yy2203; goto yy2184; yy2186: yych = *(marker = ++p); if (yych == '~') goto yy2196; goto yy2184; yy2187: yych = *++p; goto yy2184; yy2188: yych = *++p; if (yych <= 0x7F) goto yy2189; if (yych <= 0xBF) goto yy2187; yy2189: p = marker; goto yy2184; yy2190: yych = *++p; if (yych <= 0x9F) goto yy2189; if (yych <= 0xBF) goto yy2188; goto yy2189; yy2191: yych = *++p; if (yych <= 0x7F) goto yy2189; if (yych <= 0xBF) goto yy2188; goto yy2189; yy2192: yych = *++p; if (yych <= 0x8F) goto yy2189; if (yych <= 0xBF) goto yy2191; goto yy2189; yy2193: yych = *++p; if (yych <= 0x7F) goto yy2189; if (yych <= 0xBF) goto yy2191; goto yy2189; yy2194: yych = *++p; if (yych <= 0x7F) goto yy2189; if (yych <= 0x8F) goto yy2191; goto yy2189; yy2195: yych = *++p; if (yych <= 0x7F) goto yy2189; if (yych <= 0x9F) goto yy2188; goto yy2189; yy2196: yych = *++p; if (yybm[0 + yych] & 32) { goto yy2197; } goto yy2189; yy2197: marker = p + 1; ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy2199; } if (yych <= '\f') { if (yych <= 0x08) goto yy2189; if (yych <= '\n') goto yy2201; goto yy2189; } else { if (yych <= '\r') goto yy2201; if (yych == '~') goto yy2197; goto yy2189; } yy2199: ++p; yych = *p; if (yybm[0 + yych] & 64) { goto yy2199; } if (yych <= 0x08) goto yy2189; if (yych <= '\n') goto yy2201; if (yych != '\r') goto yy2189; yy2201: ++p; p = marker; { return (bufsize_t)(p - start); } yy2203: yych = *++p; if (yybm[0 + yych] & 128) { goto yy2204; } goto yy2189; yy2204: marker = p + 1; ++p; yych = *p; if (yybm[0 + yych] & 128) { goto yy2204; } if (yych <= '\f') { if (yych <= 0x08) goto yy2189; if (yych <= '\t') goto yy2206; if (yych <= '\n') goto yy2208; goto yy2189; } else { if (yych <= '\r') goto yy2208; if (yych != ' ') goto yy2189; } yy2206: ++p; yych = *p; if (yych <= '\f') { if (yych <= 0x08) goto yy2189; if (yych <= '\t') goto yy2206; if (yych >= '\v') goto yy2189; } else { if (yych <= '\r') goto yy2208; if (yych == ' ') goto yy2206; goto yy2189; } yy2208: ++p; p = marker; { return (bufsize_t)(p - start); } } } // Scans an entity. // Returns number of chars matched. bufsize_t _scan_entity(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; yych = *(marker = p); if (yych <= 0xDF) { if (yych <= '%') { if (yych != '\n') goto yy2214; } else { if (yych <= '&') goto yy2213; if (yych <= 0x7F) goto yy2214; if (yych >= 0xC2) goto yy2215; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy2217; if (yych == 0xED) goto yy2222; goto yy2218; } else { if (yych <= 0xF0) goto yy2219; if (yych <= 0xF3) goto yy2220; if (yych <= 0xF4) goto yy2221; } } yy2212 : { return 0; } yy2213: yych = *(marker = ++p); if (yych <= '@') { if (yych == '#') goto yy2223; goto yy2212; } else { if (yych <= 'Z') goto yy2224; if (yych <= '`') goto yy2212; if (yych <= 'z') goto yy2224; goto yy2212; } yy2214: yych = *++p; goto yy2212; yy2215: yych = *++p; if (yych <= 0x7F) goto yy2216; if (yych <= 0xBF) goto yy2214; yy2216: p = marker; goto yy2212; yy2217: yych = *++p; if (yych <= 0x9F) goto yy2216; if (yych <= 0xBF) goto yy2215; goto yy2216; yy2218: yych = *++p; if (yych <= 0x7F) goto yy2216; if (yych <= 0xBF) goto yy2215; goto yy2216; yy2219: yych = *++p; if (yych <= 0x8F) goto yy2216; if (yych <= 0xBF) goto yy2218; goto yy2216; yy2220: yych = *++p; if (yych <= 0x7F) goto yy2216; if (yych <= 0xBF) goto yy2218; goto yy2216; yy2221: yych = *++p; if (yych <= 0x7F) goto yy2216; if (yych <= 0x8F) goto yy2218; goto yy2216; yy2222: yych = *++p; if (yych <= 0x7F) goto yy2216; if (yych <= 0x9F) goto yy2215; goto yy2216; yy2223: yych = *++p; if (yych <= 'W') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2259; goto yy2216; } else { if (yych <= 'X') goto yy2258; if (yych == 'x') goto yy2258; goto yy2216; } yy2224: yych = *++p; if (yych <= '@') { if (yych <= '/') goto yy2216; if (yych >= ':') goto yy2216; } else { if (yych <= 'Z') goto yy2225; if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } yy2225: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2228; if (yych <= ':') goto yy2216; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; goto yy2228; } else { if (yych <= '`') goto yy2216; if (yych <= 'z') goto yy2228; goto yy2216; } } yy2226: ++p; { return (bufsize_t)(p - start); } yy2228: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2229; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2229: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2230; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2230: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2231; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2231: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2232; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2232: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2233; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2233: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2234; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2234: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2235; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2235: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2236; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2236: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2237; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2237: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2238; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2238: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2239; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2239: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2240; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2240: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2241; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2241: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2242; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2242: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2243; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2243: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2244; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2244: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2245; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2245: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2246; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2246: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2247; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2247: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2248; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2248: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2249; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2249: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2250; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2250: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2251; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2251: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2252; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2252: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2253; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2253: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2254; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2254: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2255; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2255: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2256; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2256: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2257; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'Z') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= '{') goto yy2216; } } yy2257: yych = *++p; if (yych == ';') goto yy2226; goto yy2216; yy2258: yych = *++p; if (yych <= '@') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2266; goto yy2216; } else { if (yych <= 'F') goto yy2266; if (yych <= '`') goto yy2216; if (yych <= 'f') goto yy2266; goto yy2216; } yy2259: yych = *++p; if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2260; if (yych == ';') goto yy2226; goto yy2216; yy2260: yych = *++p; if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2261; if (yych == ';') goto yy2226; goto yy2216; yy2261: yych = *++p; if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2262; if (yych == ';') goto yy2226; goto yy2216; yy2262: yych = *++p; if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2263; if (yych == ';') goto yy2226; goto yy2216; yy2263: yych = *++p; if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2264; if (yych == ';') goto yy2226; goto yy2216; yy2264: yych = *++p; if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2265; if (yych == ';') goto yy2226; goto yy2216; yy2265: yych = *++p; if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2257; if (yych == ';') goto yy2226; goto yy2216; yy2266: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2267; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'F') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= 'g') goto yy2216; } } yy2267: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2268; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'F') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= 'g') goto yy2216; } } yy2268: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2269; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'F') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= 'g') goto yy2216; } } yy2269: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2270; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'F') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= 'g') goto yy2216; } } yy2270: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2271; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'F') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= 'g') goto yy2216; } } yy2271: yych = *++p; if (yych <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2272; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'F') { if (yych <= '@') goto yy2216; } else { if (yych <= '`') goto yy2216; if (yych >= 'g') goto yy2216; } } yy2272: ++p; if ((yych = *p) <= ';') { if (yych <= '/') goto yy2216; if (yych <= '9') goto yy2257; if (yych <= ':') goto yy2216; goto yy2226; } else { if (yych <= 'F') { if (yych <= '@') goto yy2216; goto yy2257; } else { if (yych <= '`') goto yy2216; if (yych <= 'f') goto yy2257; goto yy2216; } } } } // Returns positive value if a URL begins in a way that is potentially // dangerous, with javascript:, vbscript:, file:, or data:, otherwise 0. bufsize_t _scan_dangerous_url(const unsigned char *p) { const unsigned char *marker = NULL; const unsigned char *start = p; { unsigned char yych; unsigned int yyaccept = 0; yych = *(marker = p); if (yych <= 'f') { if (yych <= 'I') { if (yych <= 'C') { if (yych != '\n') goto yy2280; } else { if (yych <= 'D') goto yy2276; if (yych == 'F') goto yy2279; goto yy2280; } } else { if (yych <= 'V') { if (yych <= 'J') goto yy2277; if (yych <= 'U') goto yy2280; goto yy2278; } else { if (yych == 'd') goto yy2276; if (yych <= 'e') goto yy2280; goto yy2279; } } } else { if (yych <= 0xDF) { if (yych <= 'u') { if (yych == 'j') goto yy2277; goto yy2280; } else { if (yych <= 'v') goto yy2278; if (yych <= 0x7F) goto yy2280; if (yych >= 0xC2) goto yy2281; } } else { if (yych <= 0xEF) { if (yych <= 0xE0) goto yy2283; if (yych == 0xED) goto yy2288; goto yy2284; } else { if (yych <= 0xF0) goto yy2285; if (yych <= 0xF3) goto yy2286; if (yych <= 0xF4) goto yy2287; } } } yy2275 : { return 0; } yy2276: yyaccept = 0; yych = *(marker = ++p); if (yych == 'A') goto yy2310; if (yych == 'a') goto yy2310; goto yy2275; yy2277: yyaccept = 0; yych = *(marker = ++p); if (yych == 'A') goto yy2301; if (yych == 'a') goto yy2301; goto yy2275; yy2278: yyaccept = 0; yych = *(marker = ++p); if (yych == 'B') goto yy2294; if (yych == 'b') goto yy2294; goto yy2275; yy2279: yyaccept = 0; yych = *(marker = ++p); if (yych == 'I') goto yy2289; if (yych == 'i') goto yy2289; goto yy2275; yy2280: yych = *++p; goto yy2275; yy2281: yych = *++p; if (yych <= 0x7F) goto yy2282; if (yych <= 0xBF) goto yy2280; yy2282: p = marker; if (yyaccept == 0) { goto yy2275; } else { goto yy2293; } yy2283: yych = *++p; if (yych <= 0x9F) goto yy2282; if (yych <= 0xBF) goto yy2281; goto yy2282; yy2284: yych = *++p; if (yych <= 0x7F) goto yy2282; if (yych <= 0xBF) goto yy2281; goto yy2282; yy2285: yych = *++p; if (yych <= 0x8F) goto yy2282; if (yych <= 0xBF) goto yy2284; goto yy2282; yy2286: yych = *++p; if (yych <= 0x7F) goto yy2282; if (yych <= 0xBF) goto yy2284; goto yy2282; yy2287: yych = *++p; if (yych <= 0x7F) goto yy2282; if (yych <= 0x8F) goto yy2284; goto yy2282; yy2288: yych = *++p; if (yych <= 0x7F) goto yy2282; if (yych <= 0x9F) goto yy2281; goto yy2282; yy2289: yych = *++p; if (yych == 'L') goto yy2290; if (yych != 'l') goto yy2282; yy2290: yych = *++p; if (yych == 'E') goto yy2291; if (yych != 'e') goto yy2282; yy2291: yych = *++p; if (yych != ':') goto yy2282; yy2292: ++p; yy2293 : { return (bufsize_t)(p - start); } yy2294: yych = *++p; if (yych == 'S') goto yy2295; if (yych != 's') goto yy2282; yy2295: yych = *++p; if (yych == 'C') goto yy2296; if (yych != 'c') goto yy2282; yy2296: yych = *++p; if (yych == 'R') goto yy2297; if (yych != 'r') goto yy2282; yy2297: yych = *++p; if (yych == 'I') goto yy2298; if (yych != 'i') goto yy2282; yy2298: yych = *++p; if (yych == 'P') goto yy2299; if (yych != 'p') goto yy2282; yy2299: yych = *++p; if (yych == 'T') goto yy2300; if (yych != 't') goto yy2282; yy2300: yych = *++p; if (yych == ':') goto yy2292; goto yy2282; yy2301: yych = *++p; if (yych == 'V') goto yy2302; if (yych != 'v') goto yy2282; yy2302: yych = *++p; if (yych == 'A') goto yy2303; if (yych != 'a') goto yy2282; yy2303: yych = *++p; if (yych == 'S') goto yy2304; if (yych != 's') goto yy2282; yy2304: yych = *++p; if (yych == 'C') goto yy2305; if (yych != 'c') goto yy2282; yy2305: yych = *++p; if (yych == 'R') goto yy2306; if (yych != 'r') goto yy2282; yy2306: yych = *++p; if (yych == 'I') goto yy2307; if (yych != 'i') goto yy2282; yy2307: yych = *++p; if (yych == 'P') goto yy2308; if (yych != 'p') goto yy2282; yy2308: yych = *++p; if (yych == 'T') goto yy2309; if (yych != 't') goto yy2282; yy2309: yych = *++p; if (yych == ':') goto yy2292; goto yy2282; yy2310: yych = *++p; if (yych == 'T') goto yy2311; if (yych != 't') goto yy2282; yy2311: yych = *++p; if (yych == 'A') goto yy2312; if (yych != 'a') goto yy2282; yy2312: yych = *++p; if (yych != ':') goto yy2282; yyaccept = 1; yych = *(marker = ++p); if (yych == 'I') goto yy2314; if (yych != 'i') goto yy2293; yy2314: yych = *++p; if (yych == 'M') goto yy2315; if (yych != 'm') goto yy2282; yy2315: yych = *++p; if (yych == 'A') goto yy2316; if (yych != 'a') goto yy2282; yy2316: yych = *++p; if (yych == 'G') goto yy2317; if (yych != 'g') goto yy2282; yy2317: yych = *++p; if (yych == 'E') goto yy2318; if (yych != 'e') goto yy2282; yy2318: yych = *++p; if (yych != '/') goto yy2282; yych = *++p; if (yych <= 'W') { if (yych <= 'J') { if (yych == 'G') goto yy2321; if (yych <= 'I') goto yy2282; goto yy2322; } else { if (yych == 'P') goto yy2320; if (yych <= 'V') goto yy2282; goto yy2323; } } else { if (yych <= 'j') { if (yych == 'g') goto yy2321; if (yych <= 'i') goto yy2282; goto yy2322; } else { if (yych <= 'p') { if (yych <= 'o') goto yy2282; } else { if (yych == 'w') goto yy2323; goto yy2282; } } } yy2320: yych = *++p; if (yych == 'N') goto yy2331; if (yych == 'n') goto yy2331; goto yy2282; yy2321: yych = *++p; if (yych == 'I') goto yy2330; if (yych == 'i') goto yy2330; goto yy2282; yy2322: yych = *++p; if (yych == 'P') goto yy2328; if (yych == 'p') goto yy2328; goto yy2282; yy2323: yych = *++p; if (yych == 'E') goto yy2324; if (yych != 'e') goto yy2282; yy2324: yych = *++p; if (yych == 'B') goto yy2325; if (yych != 'b') goto yy2282; yy2325: yych = *++p; if (yych == 'P') goto yy2326; if (yych != 'p') goto yy2282; yy2326: ++p; { return 0; } yy2328: yych = *++p; if (yych == 'E') goto yy2329; if (yych != 'e') goto yy2282; yy2329: yych = *++p; if (yych == 'G') goto yy2326; if (yych == 'g') goto yy2326; goto yy2282; yy2330: yych = *++p; if (yych == 'F') goto yy2326; if (yych == 'f') goto yy2326; goto yy2282; yy2331: ++p; if ((yych = *p) == 'G') goto yy2326; if (yych == 'g') goto yy2326; goto yy2282; } }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/CodeGen/builtins-ppc-quadword.c
// REQUIRES: powerpc-registered-target // RUN: %clang_cc1 -faltivec -target-feature +power8-vector \ // RUN: -triple powerpc64-unknown-unknown -emit-llvm %s -o - | FileCheck %s // RUN: %clang_cc1 -faltivec -target-feature +power8-vector \ // RUN: -triple powerpc64le-unknown-unknown -emit-llvm %s -o - \ // RUN: | FileCheck %s -check-prefix=CHECK-LE // RUN: not %clang_cc1 -faltivec -triple powerpc-unknown-unknown \ // RUN: -emit-llvm %s -o - 2>&1 | FileCheck %s -check-prefix=CHECK-PPC #include <altivec.h> // CHECK-PPC: error: __int128 is not supported on this target vector signed __int128 vlll = { -1 }; // CHECK-PPC: error: __int128 is not supported on this target vector unsigned __int128 vulll = { 1 }; signed long long param_sll; // CHECK-PPC: error: __int128 is not supported on this target signed __int128 param_lll; // CHECK-PPC: error: __int128 is not supported on this target unsigned __int128 param_ulll; // CHECK-PPC: error: __int128 is not supported on this target vector signed __int128 res_vlll; // CHECK-PPC: error: __int128 is not supported on this target vector unsigned __int128 res_vulll; // CHECK-LABEL: define void @test1 void test1() { /* vec_add */ res_vlll = vec_add(vlll, vlll); // CHECK: add <1 x i128> // CHECK-LE: add <1 x i128> // CHECK-PPC: error: call to 'vec_add' is ambiguous res_vulll = vec_add(vulll, vulll); // CHECK: add <1 x i128> // CHECK-LE: add <1 x i128> // CHECK-PPC: error: call to 'vec_add' is ambiguous /* vec_vadduqm */ res_vlll = vec_vadduqm(vlll, vlll); // CHECK: add <1 x i128> // CHECK-LE: add <1 x i128> // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_vadduqm(vulll, vulll); // CHECK: add <1 x i128> // CHECK-LE: add <1 x i128> // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' /* vec_vaddeuqm */ res_vlll = vec_vaddeuqm(vlll, vlll, vlll); // CHECK: @llvm.ppc.altivec.vaddeuqm // CHECK-LE: @llvm.ppc.altivec.vaddeuqm // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_vaddeuqm(vulll, vulll, vulll); // CHECK: @llvm.ppc.altivec.vaddeuqm // CHECK-LE: @llvm.ppc.altivec.vaddeuqm // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' /* vec_addc */ res_vlll = vec_addc(vlll, vlll); // CHECK: @llvm.ppc.altivec.vaddcuq // CHECK-LE: @llvm.ppc.altivec.vaddcuq // KCHECK-PPC: error: call to 'vec_addc' is ambiguous res_vulll = vec_addc(vulll, vulll); // CHECK: @llvm.ppc.altivec.vaddcuq // CHECK-LE: @llvm.ppc.altivec.vaddcuq // KCHECK-PPC: error: call to 'vec_addc' is ambiguous /* vec_vaddcuq */ res_vlll = vec_vaddcuq(vlll, vlll); // CHECK: @llvm.ppc.altivec.vaddcuq // CHECK-LE: @llvm.ppc.altivec.vaddcuq // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_vaddcuq(vulll, vulll); // CHECK: @llvm.ppc.altivec.vaddcuq // CHECK-LE: @llvm.ppc.altivec.vaddcuq // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' /* vec_vaddecuq */ res_vlll = vec_vaddecuq(vlll, vlll, vlll); // CHECK: @llvm.ppc.altivec.vaddecuq // CHECK-LE: @llvm.ppc.altivec.vaddecuq // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_vaddecuq(vulll, vulll, vulll); // CHECK: @llvm.ppc.altivec.vaddecuq // CHECK-LE: @llvm.ppc.altivec.vaddecuq // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' /* vec_sub */ res_vlll = vec_sub(vlll, vlll); // CHECK: sub <1 x i128> // CHECK-LE: sub <1 x i128> // CHECK-PPC: error: call to 'vec_sub' is ambiguous res_vulll = vec_sub(vulll, vulll); // CHECK: sub <1 x i128> // CHECK-LE: sub <1 x i128> // CHECK-PPC: error: call to 'vec_sub' is ambiguous /* vec_vsubuqm */ res_vlll = vec_vsubuqm(vlll, vlll); // CHECK: sub <1 x i128> // CHECK-LE: sub <1 x i128> // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_vsubuqm(vulll, vulll); // CHECK: sub <1 x i128> // CHECK-LE: sub <1 x i128> // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' /* vec_vsubeuqm */ res_vlll = vec_vsubeuqm(vlll, vlll, vlll); // CHECK: @llvm.ppc.altivec.vsubeuqm // CHECK-LE: @llvm.ppc.altivec.vsubeuqm // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' /* vec_sube */ res_vlll = vec_sube(vlll, vlll, vlll); // CHECK: @llvm.ppc.altivec.vsubeuqm // CHECK-LE: @llvm.ppc.altivec.vsubeuqm // CHECK-PPC: error: call to 'vec_sube' is ambiguous res_vulll = vec_sube(vulll, vulll, vulll); // CHECK: @llvm.ppc.altivec.vsubeuqm // CHECK-LE: @llvm.ppc.altivec.vsubeuqm // CHECK-PPC: error: call to 'vec_sube' is ambiguous res_vlll = vec_sube(vlll, vlll, vlll); // CHECK: @llvm.ppc.altivec.vsubeuqm // CHECK-LE: @llvm.ppc.altivec.vsubeuqm // CHECK-PPC: error: call to 'vec_sube' is ambiguous res_vulll = vec_vsubeuqm(vulll, vulll, vulll); // CHECK: @llvm.ppc.altivec.vsubeuqm // CHECK-LE: @llvm.ppc.altivec.vsubeuqm // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' res_vulll = vec_sube(vulll, vulll, vulll); // CHECK: @llvm.ppc.altivec.vsubeuqm // CHECK-LE: @llvm.ppc.altivec.vsubeuqm // CHECK-PPC: error: call to 'vec_sube' is ambiguous /* vec_subc */ res_vlll = vec_subc(vlll, vlll); // CHECK: @llvm.ppc.altivec.vsubcuq // CHECK-LE: @llvm.ppc.altivec.vsubcuq // KCHECK-PPC: error: call to 'vec_subc' is ambiguous res_vulll = vec_subc(vulll, vulll); // CHECK: @llvm.ppc.altivec.vsubcuq // CHECK-LE: @llvm.ppc.altivec.vsubcuq // KCHECK-PPC: error: call to 'vec_subc' is ambiguous /* vec_vsubcuq */ res_vlll = vec_vsubcuq(vlll, vlll); // CHECK: @llvm.ppc.altivec.vsubcuq // CHECK-LE: @llvm.ppc.altivec.vsubcuq // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_vsubcuq(vulll, vulll); // CHECK: @llvm.ppc.altivec.vsubcuq // CHECK-LE: @llvm.ppc.altivec.vsubcuq // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' /* vec_vsubecuq */ res_vlll = vec_vsubecuq(vlll, vlll, vlll); // CHECK: @llvm.ppc.altivec.vsubecuq // CHECK-LE: @llvm.ppc.altivec.vsubecuq // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_vsubecuq(vulll, vulll, vulll); // CHECK: @llvm.ppc.altivec.vsubecuq // CHECK-LE: @llvm.ppc.altivec.vsubecuq // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' res_vlll = vec_subec(vlll, vlll, vlll); // CHECK: @llvm.ppc.altivec.vsubecuq // CHECK-LE: @llvm.ppc.altivec.vsubecuq // CHECK-PPC: error: assigning to '__vector __int128' (vector of 1 '__int128' value) from incompatible type 'int' res_vulll = vec_subec(vulll, vulll, vulll); // CHECK: @llvm.ppc.altivec.vsubecuq // CHECK-LE: @llvm.ppc.altivec.vsubecuq // CHECK-PPC: error: assigning to '__vector unsigned __int128' (vector of 1 'unsigned __int128' value) from incompatible type 'int' res_vulll = vec_revb(vulll); // CHECK: store <16 x i8> <i8 15, i8 14, i8 13, i8 12, i8 11, i8 10, i8 9, i8 8, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>, <16 x i8>* {{%.+}}, align 16 // CHECK: call <4 x i32> @llvm.ppc.altivec.vperm(<4 x i32> {{%.+}}, <4 x i32> {{%.+}}, <16 x i8> {{%.+}}) // CHECK-LE: store <16 x i8> <i8 15, i8 14, i8 13, i8 12, i8 11, i8 10, i8 9, i8 8, i8 7, i8 6, i8 5, i8 4, i8 3, i8 2, i8 1, i8 0>, <16 x i8>* {{%.+}}, align 16 // CHECK-LE: store <16 x i8> <i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1>, <16 x i8>* {{%.+}}, align 16 // CHECK-LE: xor <16 x i8> // CHECK-LE: call <4 x i32> @llvm.ppc.altivec.vperm(<4 x i32> {{%.+}}, <4 x i32> {{%.+}}, <16 x i8> {{%.+}}) // CHECK_PPC: error: call to 'vec_revb' is ambiguous /* vec_xl */ res_vlll = vec_xl(param_sll, &param_lll); // CHECK: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xl' is ambiguous res_vulll = vec_xl(param_sll, &param_ulll); // CHECK: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xl' is ambiguous /* vec_xst */ vec_xst(vlll, param_sll, &param_lll); // CHECK: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xst' is ambiguous vec_xst(vulll, param_sll, &param_ulll); // CHECK: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xst' is ambiguous /* vec_xl_be */ res_vlll = vec_xl_be(param_sll, &param_lll); // CHECK: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xl' is ambiguous res_vulll = vec_xl_be(param_sll, &param_ulll); // CHECK: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: load <1 x i128>, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xl' is ambiguous /* vec_xst_be */ vec_xst_be(vlll, param_sll, &param_lll); // CHECK: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xst' is ambiguous vec_xst_be(vulll, param_sll, &param_ulll); // CHECK: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-LE: store <1 x i128> %{{[0-9]+}}, <1 x i128>* %{{[0-9]+}}, align 16 // CHECK-PPC: error: call to 'vec_xst' is ambiguous }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/CodeGen/ms-x86-intrinsics.c
<gh_stars>100-1000 // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \ // RUN: -triple i686--windows -Oz -emit-llvm %s -o - \ // RUN: | FileCheck %s -check-prefix=CHECK -check-prefix=CHECK-I386 // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \ // RUN: -triple x86_64--windows -Oz -emit-llvm %s -o - \ // RUN: | FileCheck %s --check-prefix=CHECK --check-prefix=CHECK-X64 #if defined(__i386__) long test__readfsdword(unsigned long Offset) { return __readfsdword(Offset); } // CHECK-I386-LABEL: define i32 @test__readfsdword(i32 %Offset){{.*}}{ // CHECK-I386: [[PTR:%[0-9]+]] = inttoptr i32 %Offset to i32 addrspace(257)* // CHECK-I386: [[VALUE:%[0-9]+]] = load volatile i32, i32 addrspace(257)* [[PTR]], align 4 // CHECK-I386: ret i32 [[VALUE:%[0-9]+]] // CHECK-I386: } #endif __int64 test__emul(int a, int b) { return __emul(a, b); } // CHECK-LABEL: define i64 @test__emul(i32 %a, i32 %b) // CHECK: [[X:%[0-9]+]] = sext i32 %a to i64 // CHECK: [[Y:%[0-9]+]] = sext i32 %b to i64 // CHECK: [[RES:%[0-9]+]] = mul nsw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] unsigned __int64 test__emulu(unsigned int a, unsigned int b) { return __emulu(a, b); } // CHECK-LABEL: define i64 @test__emulu(i32 %a, i32 %b) // CHECK: [[X:%[0-9]+]] = zext i32 %a to i64 // CHECK: [[Y:%[0-9]+]] = zext i32 %b to i64 // CHECK: [[RES:%[0-9]+]] = mul nuw i64 [[Y]], [[X]] // CHECK: ret i64 [[RES]] #if defined(__x86_64__) __int64 test__mulh(__int64 a, __int64 b) { return __mulh(a, b); } // CHECK-X64-LABEL: define i64 @test__mulh(i64 %a, i64 %b) // CHECK-X64: = mul nsw i128 % unsigned __int64 test__umulh(unsigned __int64 a, unsigned __int64 b) { return __umulh(a, b); } // CHECK-X64-LABEL: define i64 @test__umulh(i64 %a, i64 %b) // CHECK-X64: = mul nuw i128 % __int64 test_mul128(__int64 Multiplier, __int64 Multiplicand, __int64 *HighProduct) { return _mul128(Multiplier, Multiplicand, HighProduct); } // CHECK-X64-LABEL: define i64 @test_mul128(i64 %Multiplier, i64 %Multiplicand, i64*{{[a-z_ ]*}}%HighProduct) // CHECK-X64: = sext i64 %Multiplier to i128 // CHECK-X64: = sext i64 %Multiplicand to i128 // CHECK-X64: = mul nsw i128 % // CHECK-X64: store i64 % // CHECK-X64: ret i64 % unsigned __int64 test_umul128(unsigned __int64 Multiplier, unsigned __int64 Multiplicand, unsigned __int64 *HighProduct) { return _umul128(Multiplier, Multiplicand, HighProduct); } // CHECK-X64-LABEL: define i64 @test_umul128(i64 %Multiplier, i64 %Multiplicand, i64*{{[a-z_ ]*}}%HighProduct) // CHECK-X64: = zext i64 %Multiplier to i128 // CHECK-X64: = zext i64 %Multiplicand to i128 // CHECK-X64: = mul nuw i128 % // CHECK-X64: store i64 % // CHECK-X64: ret i64 % #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/msvc/Config.h
//===-- Config.h -----------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// //---------------------------------------------------------------------- // LLDB currently doesn't have a dynamic configuration mechanism, so we // are going to hardcode things for now. Eventually these files will // be auto generated by some configuration script that can detect // platform functionality availability. //---------------------------------------------------------------------- #ifndef liblldb_host_msvc_Config_h_ #define liblldb_host_msvc_Config_h_ #define LLDB_DISABLE_POSIX //#define LLDB_CONFIG_TERMIOS_SUPPORTED 1 //#define LLDB_CONFIG_TILDE_RESOLVES_TO_USER 1 //#define LLDB_CONFIG_DLOPEN_RTLD_FIRST_SUPPORTED 1 //#define LLDB_CONFIG_FCNTL_GETPATH_SUPPORTED 1 #if _HAS_EXCEPTIONS == 0 // Due to a bug in <thread>, when _HAS_EXCEPTIONS == 0 the header will try to // call // uncaught_exception() without having a declaration for it. The fix for this // is // to manually #include <eh.h>, which contains this declaration. #include <eh.h> #endif #endif // #ifndef liblldb_Platform_Config_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift-corelibs-foundation/CoreFoundation/PlugIn.subproj/CFBundle.c
<filename>SymbolExtractorAndRenamer/swift-corelibs-foundation/CoreFoundation/PlugIn.subproj/CFBundle.c /* CFBundle.c Copyright (c) 1999-2016, Apple Inc. and the Swift project authors Portions Copyright (c) 2014-2016 Apple Inc. and the Swift project authors Licensed under Apache License v2.0 with Runtime Library Exception See http://swift.org/LICENSE.txt for license information See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors Responsibility: <NAME> */ #include "CFBundle_Internal.h" #include <CoreFoundation/CFPropertyList.h> #include <CoreFoundation/CFNumber.h> #include <CoreFoundation/CFSet.h> #include <CoreFoundation/CFURLAccess.h> #include <CoreFoundation/CFError.h> #include <string.h> #include <CoreFoundation/CFPriv.h> #include "CFInternal.h" #include <CoreFoundation/CFByteOrder.h> #include "CFBundle_BinaryTypes.h" #include <ctype.h> #include <sys/stat.h> #include <stdlib.h> #if defined(BINARY_SUPPORT_DYLD) #include <unistd.h> #include <fcntl.h> #include <sys/mman.h> #include <crt_externs.h> #endif /* BINARY_SUPPORT_DYLD */ #if defined(BINARY_SUPPORT_DLFCN) #include <dlfcn.h> #ifndef RTLD_FIRST #define RTLD_FIRST 0 #endif #endif /* BINARY_SUPPORT_DLFCN */ #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI #include <fcntl.h> #elif DEPLOYMENT_TARGET_WINDOWS #include <fcntl.h> #include <io.h> #endif static void _CFBundleFlushBundleCachesAlreadyLocked(CFBundleRef bundle, Boolean alreadyLocked); #define LOG_BUNDLE_LOAD 0 // Public CFBundle Info plist keys CONST_STRING_DECL(kCFBundleInfoDictionaryVersionKey, "CFBundleInfoDictionaryVersion") CONST_STRING_DECL(kCFBundleExecutableKey, "CFBundleExecutable") CONST_STRING_DECL(kCFBundleIdentifierKey, "CFBundleIdentifier") CONST_STRING_DECL(kCFBundleVersionKey, "CFBundleVersion") CONST_STRING_DECL(kCFBundleDevelopmentRegionKey, "CFBundleDevelopmentRegion") CONST_STRING_DECL(kCFBundleLocalizationsKey, "CFBundleLocalizations") // Private CFBundle Info plist keys, possible candidates for public constants CONST_STRING_DECL(_kCFBundleAllowMixedLocalizationsKey, "CFBundleAllowMixedLocalizations") CONST_STRING_DECL(_kCFBundleSupportedPlatformsKey, "CFBundleSupportedPlatforms") CONST_STRING_DECL(_kCFBundleResourceSpecificationKey, "CFBundleResourceSpecification") // Finder stuff CONST_STRING_DECL(_kCFBundlePackageTypeKey, "CFBundlePackageType") CONST_STRING_DECL(_kCFBundleSignatureKey, "CFBundleSignature") CONST_STRING_DECL(_kCFBundleIconFileKey, "CFBundleIconFile") CONST_STRING_DECL(_kCFBundleDocumentTypesKey, "CFBundleDocumentTypes") CONST_STRING_DECL(_kCFBundleURLTypesKey, "CFBundleURLTypes") // Keys that are usually localized in InfoPlist.strings CONST_STRING_DECL(kCFBundleNameKey, "CFBundleName") CONST_STRING_DECL(_kCFBundleDisplayNameKey, "CFBundleDisplayName") CONST_STRING_DECL(_kCFBundleShortVersionStringKey, "CFBundleShortVersionString") CONST_STRING_DECL(_kCFBundleGetInfoStringKey, "CFBundleGetInfoString") CONST_STRING_DECL(_kCFBundleGetInfoHTMLKey, "CFBundleGetInfoHTML") // Sub-keys for CFBundleDocumentTypes dictionaries CONST_STRING_DECL(_kCFBundleTypeNameKey, "CFBundleTypeName") CONST_STRING_DECL(_kCFBundleTypeRoleKey, "CFBundleTypeRole") CONST_STRING_DECL(_kCFBundleTypeIconFileKey, "CFBundleTypeIconFile") CONST_STRING_DECL(_kCFBundleTypeOSTypesKey, "CFBundleTypeOSTypes") CONST_STRING_DECL(_kCFBundleTypeExtensionsKey, "CFBundleTypeExtensions") CONST_STRING_DECL(_kCFBundleTypeMIMETypesKey, "CFBundleTypeMIMETypes") // Sub-keys for CFBundleURLTypes dictionaries CONST_STRING_DECL(_kCFBundleURLNameKey, "CFBundleURLName") CONST_STRING_DECL(_kCFBundleURLIconFileKey, "CFBundleURLIconFile") CONST_STRING_DECL(_kCFBundleURLSchemesKey, "CFBundleURLSchemes") // Compatibility key names CONST_STRING_DECL(_kCFBundleOldExecutableKey, "NSExecutable") CONST_STRING_DECL(_kCFBundleOldInfoDictionaryVersionKey, "NSInfoPlistVersion") CONST_STRING_DECL(_kCFBundleOldNameKey, "NSHumanReadableName") CONST_STRING_DECL(_kCFBundleOldIconFileKey, "NSIcon") CONST_STRING_DECL(_kCFBundleOldDocumentTypesKey, "NSTypes") CONST_STRING_DECL(_kCFBundleOldShortVersionStringKey, "NSAppVersion") // Compatibility CFBundleDocumentTypes key names CONST_STRING_DECL(_kCFBundleOldTypeNameKey, "NSName") CONST_STRING_DECL(_kCFBundleOldTypeRoleKey, "NSRole") CONST_STRING_DECL(_kCFBundleOldTypeIconFileKey, "NSIcon") CONST_STRING_DECL(_kCFBundleOldTypeExtensions1Key, "NSUnixExtensions") CONST_STRING_DECL(_kCFBundleOldTypeExtensions2Key, "NSDOSExtensions") CONST_STRING_DECL(_kCFBundleOldTypeOSTypesKey, "NSMacOSType") // Internally used keys for loaded Info plists. CONST_STRING_DECL(_kCFBundleInfoPlistURLKey, "CFBundleInfoPlistURL") CONST_STRING_DECL(_kCFBundleRawInfoPlistURLKey, "CFBundleRawInfoPlistURL") CONST_STRING_DECL(_kCFBundleNumericVersionKey, "CFBundleNumericVersion") CONST_STRING_DECL(_kCFBundleExecutablePathKey, "CFBundleExecutablePath") CONST_STRING_DECL(_kCFBundleResourcesFileMappedKey, "CSResourcesFileMapped") CONST_STRING_DECL(_kCFBundleCFMLoadAsBundleKey, "CFBundleCFMLoadAsBundle") // Keys used by NSBundle for loaded Info plists. CONST_STRING_DECL(_kCFBundlePrincipalClassKey, "NSPrincipalClass") static char __CFBundleMainID__[1026] = {0}; CF_PRIVATE char *__CFBundleMainID = __CFBundleMainID__; static CFTypeID __kCFBundleTypeID = _kCFRuntimeNotATypeID; static pthread_mutex_t CFBundleGlobalDataLock = PTHREAD_MUTEX_INITIALIZER; static CFMutableDictionaryRef _bundlesByIdentifier = NULL; static CFMutableDictionaryRef _bundlesByURL = NULL; static CFMutableArrayRef _allBundles = NULL; static CFMutableSetRef _bundlesToUnload = NULL; static Boolean _scheduledBundlesAreUnloading = false; static Boolean _initedMainBundle = false; static CFBundleRef _mainBundle = NULL; static CFBundleRef _CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL, Boolean alreadyLocked, Boolean doFinalProcessing, Boolean unique); static CFURLRef _CFBundleCopyExecutableURLIgnoringCache(CFBundleRef bundle); static void _CFBundleEnsureBundlesUpToDateWithHintAlreadyLocked(CFStringRef hint); static void _CFBundleEnsureAllBundlesUpToDateAlreadyLocked(void); static void _CFBundleEnsureBundleExistsForImagePath(CFStringRef imagePath); static void _CFBundleEnsureBundlesExistForImagePaths(CFArrayRef imagePaths); #pragma mark - CF_PRIVATE os_log_t _CFBundleResourceLogger(void) { static os_log_t _log; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _log = os_log_create("com.apple.CFBundle", "resources"); }); return _log; } CF_PRIVATE os_log_t _CFBundleLocalizedStringLogger(void) { static os_log_t _log; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _log = os_log_create("com.apple.CFBundle", "strings"); }); return _log; } #pragma mark - #if DEPLOYMENT_TARGET_MACOSX // Some apps may rely on the fact that CFBundle used to allow bundle objects to be deallocated (despite handing out unretained pointers via CFBundleGetBundleWithIdentifier or CFBundleGetAllBundles). To remain compatible even in the face of unsafe behavior, we can optionally use unsafe-unretained memory management for holding on to bundles. static Boolean _useUnsafeUnretainedTables(void) { return false; } #endif #pragma mark - #pragma mark Bundle Tables static void _CFBundleAddToTables(CFBundleRef bundle, Boolean alreadyLocked) { if (bundle->_isUnique) return; CFStringRef bundleID = CFBundleGetIdentifier(bundle); if (!alreadyLocked) pthread_mutex_lock(&CFBundleGlobalDataLock); // Add to the _allBundles list if (!_allBundles) { CFArrayCallBacks callbacks = kCFTypeArrayCallBacks; #if DEPLOYMENT_TARGET_MACOSX if (_useUnsafeUnretainedTables()) { callbacks.retain = NULL; callbacks.release = NULL; } #endif // The _allBundles array holds a strong reference on the bundle. // It does this to prevent a race on bundle deallocation / creation. See: <rdar://problem/6606482> CFBundle isn't thread-safe in RR mode // Also, the existence of the CFBundleGetBundleWithIdentifier / CFBundleGetAllBundles API means that any bundle we hand out from there must be permanently retained, or callers will potentially have an object that can be deallocated out from underneath them. _allBundles = CFArrayCreateMutable(kCFAllocatorSystemDefault, 0, &callbacks); } CFArrayAppendValue(_allBundles, bundle); // Add to the table that maps urls to bundles if (!_bundlesByURL) { CFDictionaryValueCallBacks nonRetainingDictionaryValueCallbacks = kCFTypeDictionaryValueCallBacks; nonRetainingDictionaryValueCallbacks.retain = NULL; nonRetainingDictionaryValueCallbacks.release = NULL; _bundlesByURL = CFDictionaryCreateMutable(kCFAllocatorSystemDefault, 0, &kCFTypeDictionaryKeyCallBacks, &nonRetainingDictionaryValueCallbacks); } CFDictionarySetValue(_bundlesByURL, bundle->_url, bundle); // Add to the table that maps identifiers to bundles if (bundleID) { CFMutableArrayRef bundlesWithThisID = NULL; CFBundleRef existingBundle = NULL; if (!_bundlesByIdentifier) { _bundlesByIdentifier = CFDictionaryCreateMutable(kCFAllocatorSystemDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); } bundlesWithThisID = (CFMutableArrayRef)CFDictionaryGetValue(_bundlesByIdentifier, bundleID); if (bundlesWithThisID) { CFIndex i, count = CFArrayGetCount(bundlesWithThisID); UInt32 existingVersion, newVersion = CFBundleGetVersionNumber(bundle); for (i = 0; i < count; i++) { existingBundle = (CFBundleRef)CFArrayGetValueAtIndex(bundlesWithThisID, i); existingVersion = CFBundleGetVersionNumber(existingBundle); // If you load two bundles with the same identifier and the same version, the last one wins. if (newVersion >= existingVersion) break; } CFArrayInsertValueAtIndex(bundlesWithThisID, i, bundle); } else { CFArrayCallBacks nonRetainingArrayCallbacks = kCFTypeArrayCallBacks; nonRetainingArrayCallbacks.retain = NULL; nonRetainingArrayCallbacks.release = NULL; bundlesWithThisID = CFArrayCreateMutable(kCFAllocatorSystemDefault, 0, &nonRetainingArrayCallbacks); CFArrayAppendValue(bundlesWithThisID, bundle); CFDictionarySetValue(_bundlesByIdentifier, bundleID, bundlesWithThisID); CFRelease(bundlesWithThisID); } } if (!alreadyLocked) pthread_mutex_unlock(&CFBundleGlobalDataLock); } static void _CFBundleRemoveFromTables(CFBundleRef bundle, CFURLRef bundleURL, CFStringRef bundleID) { // Since we no longer allow bundles to be removed from tables, this method does nothing. Modifying the tables during deallocation is risky because if the caller has over-released the bundle object then we will deadlock on the global lock. #if DEPLOYMENT_TARGET_MACOSX if (_useUnsafeUnretainedTables()) { // Except for special cases of unsafe-unretained, where we must clean up the table or risk handing out a zombie object. There may still be outstanding pointers to these bundes (e.g. the result of CFBundleGetBundleWithIdentifier) but there is nothing we can do about that after this point. // Unique bundles aren't in the tables anyway if (bundle->_isUnique) return; pthread_mutex_lock(&CFBundleGlobalDataLock); // Remove from the table of all bundles if (_allBundles) { CFIndex i = CFArrayGetFirstIndexOfValue(_allBundles, CFRangeMake(0, CFArrayGetCount(_allBundles)), bundle); if (i >= 0) CFArrayRemoveValueAtIndex(_allBundles, i); } // Remove from the table that maps urls to bundles if (bundleURL && _bundlesByURL) { CFBundleRef bundleForURL = (CFBundleRef)CFDictionaryGetValue(_bundlesByURL, bundleURL); if (bundleForURL == bundle) CFDictionaryRemoveValue(_bundlesByURL, bundleURL); } // Remove from the table that maps identifiers to bundles if (bundleID && _bundlesByIdentifier) { CFMutableArrayRef bundlesWithThisID = (CFMutableArrayRef)CFDictionaryGetValue(_bundlesByIdentifier, bundleID); if (bundlesWithThisID) { CFIndex count = CFArrayGetCount(bundlesWithThisID); while (count-- > 0) if (bundle == (CFBundleRef)CFArrayGetValueAtIndex(bundlesWithThisID, count)) CFArrayRemoveValueAtIndex(bundlesWithThisID, count); if (0 == CFArrayGetCount(bundlesWithThisID)) CFDictionaryRemoveValue(_bundlesByIdentifier, bundleID); } } pthread_mutex_unlock(&CFBundleGlobalDataLock); } #endif } #pragma mark - static CFBundleRef _CFBundleCopyBundleForURL(CFURLRef url, Boolean alreadyLocked) { CFBundleRef result = NULL; if (!alreadyLocked) pthread_mutex_lock(&CFBundleGlobalDataLock); if (_bundlesByURL) result = (CFBundleRef)CFDictionaryGetValue(_bundlesByURL, url); if (result && !result->_url) { result = NULL; CFDictionaryRemoveValue(_bundlesByURL, url); } if (result) CFRetain(result); if (!alreadyLocked) pthread_mutex_unlock(&CFBundleGlobalDataLock); return result; } static CFBundleRef _CFBundlePrimitiveGetBundleWithIdentifierAlreadyLocked(CFStringRef bundleID) { CFBundleRef result = NULL, bundle; if (_bundlesByIdentifier && bundleID) { // Note that this array is maintained in descending order by version number CFArrayRef bundlesWithThisID = (CFArrayRef)CFDictionaryGetValue(_bundlesByIdentifier, bundleID); if (bundlesWithThisID) { CFIndex i, count = CFArrayGetCount(bundlesWithThisID); if (count > 0) { // First check for loaded bundles so we will always prefer a loaded to an unloaded bundle for (i = 0; !result && i < count; i++) { bundle = (CFBundleRef)CFArrayGetValueAtIndex(bundlesWithThisID, i); if (CFBundleIsExecutableLoaded(bundle)) result = bundle; } // If no loaded bundle, simply take the first item in the array, i.e. the one with the latest version number if (!result) result = (CFBundleRef)CFArrayGetValueAtIndex(bundlesWithThisID, 0); } } } return result; } static CFURLRef _CFBundleCopyBundleURLForExecutablePath(CFStringRef str) { //!!! need to handle frameworks, NT; need to integrate with NSBundle - drd UniChar buff[CFMaxPathSize]; CFIndex buffLen; CFURLRef url = NULL; CFStringRef outstr; buffLen = CFStringGetLength(str); if (buffLen > CFMaxPathSize) buffLen = CFMaxPathSize; CFStringGetCharacters(str, CFRangeMake(0, buffLen), buff); #if DEPLOYMENT_TARGET_WINDOWS // Is this a .dll or .exe? if (buffLen >= 5 && (_wcsnicmp((wchar_t *)&(buff[buffLen-4]), L".dll", 4) == 0 || _wcsnicmp((wchar_t *)&(buff[buffLen-4]), L".exe", 4) == 0)) { CFIndex extensionLength = CFStringGetLength(_CFBundleWindowsResourceDirectoryExtension); buffLen -= 4; // If this is an _debug, we should strip that before looking for the bundle if (buffLen >= 7 && (_wcsnicmp((wchar_t *)&buff[buffLen-6], L"_debug", 6) == 0)) buffLen -= 6; if (buffLen + 1 + extensionLength < CFMaxPathSize) { buff[buffLen] = '.'; buffLen ++; CFStringGetCharacters(_CFBundleWindowsResourceDirectoryExtension, CFRangeMake(0, extensionLength), buff + buffLen); buffLen += extensionLength; outstr = CFStringCreateWithCharactersNoCopy(kCFAllocatorSystemDefault, buff, buffLen, kCFAllocatorNull); url = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, outstr, PLATFORM_PATH_STYLE, true); CFRelease(outstr); } } #endif if (!url) { buffLen = _CFLengthAfterDeletingLastPathComponent(buff, buffLen); // Remove exe name if (buffLen > 0) { // See if this is a new bundle. If it is, we have to remove more path components. CFIndex startOfLastDir = _CFStartOfLastPathComponent(buff, buffLen); if (startOfLastDir > 0 && startOfLastDir < buffLen) { CFStringRef lastDirName = CFStringCreateWithCharacters(kCFAllocatorSystemDefault, &(buff[startOfLastDir]), buffLen - startOfLastDir); if (CFEqual(lastDirName, _CFBundleGetPlatformExecutablesSubdirectoryName()) || CFEqual(lastDirName, _CFBundleGetAlternatePlatformExecutablesSubdirectoryName()) || CFEqual(lastDirName, _CFBundleGetOtherPlatformExecutablesSubdirectoryName()) || CFEqual(lastDirName, _CFBundleGetOtherAlternatePlatformExecutablesSubdirectoryName())) { // This is a new bundle. Back off a few more levels if (buffLen > 0) { // Remove platform folder buffLen = _CFLengthAfterDeletingLastPathComponent(buff, buffLen); } if (buffLen > 0) { // Remove executables folder (if present) CFIndex startOfNextDir = _CFStartOfLastPathComponent(buff, buffLen); if (startOfNextDir > 0 && startOfNextDir < buffLen) { CFStringRef nextDirName = CFStringCreateWithCharacters(kCFAllocatorSystemDefault, &(buff[startOfNextDir]), buffLen - startOfNextDir); if (CFEqual(nextDirName, _CFBundleExecutablesDirectoryName)) buffLen = _CFLengthAfterDeletingLastPathComponent(buff, buffLen); CFRelease(nextDirName); } } if (buffLen > 0) { // Remove support files folder buffLen = _CFLengthAfterDeletingLastPathComponent(buff, buffLen); } } CFRelease(lastDirName); } } if (buffLen > 0) { outstr = CFStringCreateWithCharactersNoCopy(kCFAllocatorSystemDefault, buff, buffLen, kCFAllocatorNull); url = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, outstr, PLATFORM_PATH_STYLE, true); CFRelease(outstr); } } return url; } static CFURLRef _CFBundleCopyResolvedURLForExecutableURL(CFURLRef url) { // this is necessary so that we match any sanitization CFURL may perform on the result of _CFBundleCopyBundleURLForExecutableURL() CFURLRef absoluteURL, url1, url2, outURL = NULL; CFStringRef str, str1, str2; absoluteURL = CFURLCopyAbsoluteURL(url); str = CFURLCopyFileSystemPath(absoluteURL, PLATFORM_PATH_STYLE); if (str) { UniChar buff[CFMaxPathSize]; CFIndex buffLen = CFStringGetLength(str), len1; if (buffLen > CFMaxPathSize) buffLen = CFMaxPathSize; CFStringGetCharacters(str, CFRangeMake(0, buffLen), buff); len1 = _CFLengthAfterDeletingLastPathComponent(buff, buffLen); if (len1 > 0 && len1 + 1 < buffLen) { str1 = CFStringCreateWithCharacters(kCFAllocatorSystemDefault, buff, len1); CFIndex skipSlashCount = 1; #if DEPLOYMENT_TARGET_WINDOWS // On Windows, _CFLengthAfterDeletingLastPathComponent will return a value of 3 if the path is at the root (e.g. C:\). This includes the \, which is not the case for URLs with subdirectories if (len1 == 3 && buff[1] == ':' && buff[2] == '\\') { skipSlashCount = 0; } #endif str2 = CFStringCreateWithCharacters(kCFAllocatorSystemDefault, buff + len1 + skipSlashCount, buffLen - len1 - skipSlashCount); if (str1 && str2) { url1 = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, str1, PLATFORM_PATH_STYLE, true); if (url1) { url2 = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, str2, PLATFORM_PATH_STYLE, false, url1); if (url2) { outURL = CFURLCopyAbsoluteURL(url2); CFRelease(url2); } CFRelease(url1); } } if (str1) CFRelease(str1); if (str2) CFRelease(str2); } CFRelease(str); } if (!outURL) { outURL = absoluteURL; } else { CFRelease(absoluteURL); } return outURL; } CFURLRef _CFBundleCopyBundleURLForExecutableURL(CFURLRef url) { CFURLRef resolvedURL, outurl = NULL; CFStringRef str; resolvedURL = _CFBundleCopyResolvedURLForExecutableURL(url); str = CFURLCopyFileSystemPath(resolvedURL, PLATFORM_PATH_STYLE); if (str) { outurl = _CFBundleCopyBundleURLForExecutablePath(str); CFRelease(str); } CFRelease(resolvedURL); return outurl; } static uint8_t _CFBundleEffectiveLayoutVersion(CFBundleRef bundle) { uint8_t localVersion = bundle->_version; // exclude type 0 bundles with no binary (or CFM binary) and no Info.plist, since they give too many false positives if (0 == localVersion) { CFDictionaryRef infoDict = CFBundleGetInfoDictionary(bundle); if (!infoDict || 0 == CFDictionaryGetCount(infoDict)) { #if defined(BINARY_SUPPORT_DYLD) CFURLRef executableURL = CFBundleCopyExecutableURL(bundle); if (executableURL) { if (bundle->_binaryType == __CFBundleUnknownBinary) bundle->_binaryType = _CFBundleGrokBinaryType(executableURL); if (bundle->_binaryType == __CFBundleCFMBinary || bundle->_binaryType == __CFBundleUnreadableBinary) { localVersion = 4; } else { bundle->_resourceData._executableLacksResourceFork = true; } CFRelease(executableURL); } else { localVersion = 4; } #else CFURLRef executableURL = CFBundleCopyExecutableURL(bundle); if (executableURL) { CFRelease(executableURL); } else { localVersion = 4; } #endif /* BINARY_SUPPORT_DYLD */ } } return localVersion; } CFBundleRef _CFBundleCreateIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url) { // It is assumed that users of this SPI do not want this bundle to persist forever. CFBundleRef bundle = _CFBundleCreateUnique(allocator, url); if (bundle) { uint8_t localVersion = _CFBundleEffectiveLayoutVersion(bundle); if (3 == localVersion || 4 == localVersion) { CFRelease(bundle); bundle = NULL; } } return bundle; } CF_EXPORT Boolean _CFBundleURLLooksLikeBundle(CFURLRef url) { Boolean result = false; CFBundleRef bundle = _CFBundleCreateIfLooksLikeBundle(kCFAllocatorSystemDefault, url); if (bundle) { result = true; CFRelease(bundle); } return result; } CFBundleRef _CFBundleGetMainBundleIfLooksLikeBundle(void) { CFBundleRef mainBundle = CFBundleGetMainBundle(); if (mainBundle && (3 == mainBundle->_version || 4 == mainBundle->_version)) mainBundle = NULL; return mainBundle; } Boolean _CFBundleMainBundleInfoDictionaryComesFromResourceFork(void) { CFBundleRef mainBundle = CFBundleGetMainBundle(); return (mainBundle && mainBundle->_resourceData._infoDictionaryFromResourceFork); } CFBundleRef _CFBundleCreateWithExecutableURLIfLooksLikeBundle(CFAllocatorRef allocator, CFURLRef url) { CFBundleRef bundle = NULL; CFURLRef bundleURL = _CFBundleCopyBundleURLForExecutableURL(url), resolvedURL = _CFBundleCopyResolvedURLForExecutableURL(url); if (bundleURL && resolvedURL) { // We used to call _CFBundleCreateIfLooksLikeBundle here, but switched to the regular CFBundleCreate because we want this to return a result for certain flat bundles as well. // It is assumed that users of this SPI do not want this bundle to persist forever, so we use the Unique version of CFBundleCreate. bundle = _CFBundleCreateUnique(allocator, bundleURL); if (bundle) { CFURLRef executableURL = _CFBundleCopyExecutableURLIgnoringCache(bundle); char buff1[CFMaxPathSize], buff2[CFMaxPathSize]; if (!executableURL || !CFURLGetFileSystemRepresentation(resolvedURL, true, (uint8_t *)buff1, CFMaxPathSize) || !CFURLGetFileSystemRepresentation(executableURL, true, (uint8_t *)buff2, CFMaxPathSize) || 0 != strcmp(buff1, buff2)) { CFRelease(bundle); bundle = NULL; } if (executableURL) CFRelease(executableURL); } } if (bundleURL) CFRelease(bundleURL); if (resolvedURL) CFRelease(resolvedURL); return bundle; } CFBundleRef _CFBundleCreateIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url) { // This function is obsolete CFBundleRef bundle = CFBundleCreate(allocator, url); return bundle; } CFBundleRef _CFBundleCreateWithExecutableURLIfMightBeBundle(CFAllocatorRef allocator, CFURLRef url) { CFBundleRef result = _CFBundleCreateWithExecutableURLIfLooksLikeBundle(allocator, url); // This function applies additional requirements on a bundle to return a result // The above makes sure that: // 0. CFBundleCreate must succeed using a URL derived from the executable URL // 1. The bundle must have an executableURL, and it must match the passed in executable URL // This function additionally requires that // 2. If flat, the bundle must have a non-empty Info.plist. (15663535) if (result) { uint8_t localVersion = _CFBundleEffectiveLayoutVersion(result); if (3 == localVersion || 4 == localVersion) { CFDictionaryRef infoPlist = CFBundleGetInfoDictionary(result); if (!infoPlist || (infoPlist && CFDictionaryGetCount(infoPlist) == 0)) { CFRelease(result); result = NULL; } } } return result; } CFURLRef _CFBundleCopyMainBundleExecutableURL(Boolean *looksLikeBundle) { // This function is for internal use only; _mainBundle is deliberately accessed outside of the lock to get around a reentrancy issue const char *processPath; CFStringRef str = NULL; CFURLRef executableURL = NULL; processPath = _CFProcessPath(); if (processPath) { str = CFStringCreateWithFileSystemRepresentation(kCFAllocatorSystemDefault, processPath); if (str) { executableURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, str, PLATFORM_PATH_STYLE, false); CFRelease(str); } } if (looksLikeBundle) { CFBundleRef mainBundle = _mainBundle; if (mainBundle && (3 == mainBundle->_version || 4 == mainBundle->_version)) mainBundle = NULL; *looksLikeBundle = (mainBundle ? true : false); } return executableURL; } static void _CFBundleInitializeMainBundleInfoDictionaryAlreadyLocked(CFStringRef executablePath) { CFBundleGetInfoDictionary(_mainBundle); if (!_mainBundle->_infoDict || CFDictionaryGetCount(_mainBundle->_infoDict) == 0) { // if type 3 bundle and no Info.plist, treat as unbundled, since this gives too many false positives if (_mainBundle->_version == 3) _mainBundle->_version = 4; if (_mainBundle->_version == 0) { // if type 0 bundle and no Info.plist and not main executable for bundle, treat as unbundled, since this gives too many false positives CFStringRef executableName = _CFBundleCopyExecutableName(_mainBundle, NULL, NULL); if (!executableName || !executablePath || !CFStringHasSuffix(executablePath, executableName)) _mainBundle->_version = 4; if (executableName) CFRelease(executableName); } #if defined(BINARY_SUPPORT_DYLD) if (_mainBundle->_binaryType == __CFBundleDYLDExecutableBinary) { if (_mainBundle->_infoDict) CFRelease(_mainBundle->_infoDict); _mainBundle->_infoDict = (CFDictionaryRef)_CFBundleCreateInfoDictFromMainExecutable(); } #endif /* BINARY_SUPPORT_DYLD */ } else { #if defined(BINARY_SUPPORT_DYLD) if (_mainBundle->_binaryType == __CFBundleDYLDExecutableBinary) { // if dyld and not main executable for bundle, prefer info dictionary from executable CFStringRef executableName = _CFBundleCopyExecutableName(_mainBundle, NULL, NULL); if (!executableName || !executablePath || !CFStringHasSuffix(executablePath, executableName)) { CFDictionaryRef infoDictFromExecutable = (CFDictionaryRef)_CFBundleCreateInfoDictFromMainExecutable(); if (infoDictFromExecutable && CFDictionaryGetCount(infoDictFromExecutable) > 0) { if (_mainBundle->_infoDict) CFRelease(_mainBundle->_infoDict); _mainBundle->_infoDict = infoDictFromExecutable; } else if (infoDictFromExecutable) { CFRelease(infoDictFromExecutable); } } if (executableName) CFRelease(executableName); } #endif /* BINARY_SUPPORT_DYLD */ } if (!_mainBundle->_infoDict) _mainBundle->_infoDict = CFDictionaryCreateMutable(kCFAllocatorSystemDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); if (!_mainBundle->_executablePath && executablePath) _mainBundle->_executablePath = (CFStringRef)CFRetain(executablePath); CFStringRef bundleID = (CFStringRef)CFDictionaryGetValue(_mainBundle->_infoDict, kCFBundleIdentifierKey); if (bundleID) { if (!CFStringGetCString(bundleID, __CFBundleMainID__, sizeof(__CFBundleMainID__) - 2, kCFStringEncodingUTF8)) { __CFBundleMainID__[0] = '\0'; } } } static void _CFBundleFlushBundleCachesAlreadyLocked(CFBundleRef bundle, Boolean alreadyLocked) { CFDictionaryRef oldInfoDict = bundle->_infoDict; CFTypeRef val; bundle->_infoDict = NULL; if (bundle->_localInfoDict) { CFRelease(bundle->_localInfoDict); bundle->_localInfoDict = NULL; } if (bundle->_infoPlistUrl) { CFRelease(bundle->_infoPlistUrl); bundle->_infoPlistUrl = NULL; } if (bundle->_developmentRegion) { CFRelease(bundle->_developmentRegion); bundle->_developmentRegion = NULL; } if (bundle->_executablePath) { CFRelease(bundle->_executablePath); bundle->_executablePath = NULL; } if (bundle->_searchLanguages) { CFRelease(bundle->_searchLanguages); bundle->_searchLanguages = NULL; } if (bundle->_stringTable) { CFRelease(bundle->_stringTable); bundle->_stringTable = NULL; } if (bundle == _mainBundle) { CFStringRef executablePath = bundle->_executablePath; if (!alreadyLocked) pthread_mutex_lock(&CFBundleGlobalDataLock); _CFBundleInitializeMainBundleInfoDictionaryAlreadyLocked(executablePath); if (!alreadyLocked) pthread_mutex_unlock(&CFBundleGlobalDataLock); } else { CFBundleGetInfoDictionary(bundle); } if (oldInfoDict) { if (!bundle->_infoDict) bundle->_infoDict = CFDictionaryCreateMutable(kCFAllocatorSystemDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks); val = CFDictionaryGetValue(oldInfoDict, _kCFBundlePrincipalClassKey); if (val) CFDictionarySetValue((CFMutableDictionaryRef)bundle->_infoDict, _kCFBundlePrincipalClassKey, val); CFRelease(oldInfoDict); } _CFBundleFlushQueryTableCache(bundle); } CF_EXPORT void _CFBundleFlushBundleCaches(CFBundleRef bundle) { _CFBundleFlushBundleCachesAlreadyLocked(bundle, false); } static CFBundleRef _CFBundleGetMainBundleAlreadyLocked(void) { if (!_initedMainBundle) { const char *processPath; CFStringRef str = NULL; CFURLRef executableURL = NULL, bundleURL = NULL; _initedMainBundle = true; processPath = _CFProcessPath(); if (processPath) { str = CFStringCreateWithFileSystemRepresentation(kCFAllocatorSystemDefault, processPath); if (!executableURL) executableURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, str, PLATFORM_PATH_STYLE, false); } if (executableURL) bundleURL = _CFBundleCopyBundleURLForExecutableURL(executableURL); if (bundleURL) { // make sure that main bundle has executable path //??? what if we are not the main executable in the bundle? // NB doFinalProcessing must be false here, see below _mainBundle = _CFBundleCreate(kCFAllocatorSystemDefault, bundleURL, true, false, false); if (_mainBundle) { // make sure that the main bundle is listed as loaded, and mark it as executable _mainBundle->_isLoaded = true; #if defined(BINARY_SUPPORT_DYLD) if (_mainBundle->_binaryType == __CFBundleUnknownBinary) { if (!executableURL) { _mainBundle->_binaryType = __CFBundleNoBinary; } else { _mainBundle->_binaryType = _CFBundleGrokBinaryType(executableURL); if (_mainBundle->_binaryType != __CFBundleCFMBinary && _mainBundle->_binaryType != __CFBundleUnreadableBinary) _mainBundle->_resourceData._executableLacksResourceFork = true; } } #endif /* BINARY_SUPPORT_DYLD */ // get cookie for already-loaded main bundle #if defined(BINARY_SUPPORT_DLFCN) if (!_mainBundle->_handleCookie) { _mainBundle->_handleCookie = dlopen(NULL, RTLD_NOLOAD | RTLD_FIRST); #if LOG_BUNDLE_LOAD printf("main bundle %p getting handle %p\n", _mainBundle, _mainBundle->_handleCookie); #endif /* LOG_BUNDLE_LOAD */ } #elif defined(BINARY_SUPPORT_DYLD) if (_mainBundle->_binaryType == __CFBundleDYLDExecutableBinary && !_mainBundle->_imageCookie) { _mainBundle->_imageCookie = (void *)_dyld_get_image_header(0); #if LOG_BUNDLE_LOAD printf("main bundle %p getting image %p\n", _mainBundle, _mainBundle->_imageCookie); #endif /* LOG_BUNDLE_LOAD */ } #endif /* BINARY_SUPPORT_DLFCN */ _CFBundleInitializeMainBundleInfoDictionaryAlreadyLocked(str); // Perform delayed final processing steps. // This must be done after _isLoaded has been set, for security reasons (3624341). if (_CFBundleNeedsInitPlugIn(_mainBundle)) { pthread_mutex_unlock(&CFBundleGlobalDataLock); _CFBundleInitPlugIn(_mainBundle); pthread_mutex_lock(&CFBundleGlobalDataLock); } } } if (bundleURL) CFRelease(bundleURL); if (str) CFRelease(str); if (executableURL) CFRelease(executableURL); } return _mainBundle; } CFBundleRef CFBundleGetMainBundle(void) { CFBundleRef mainBundle; pthread_mutex_lock(&CFBundleGlobalDataLock); mainBundle = _CFBundleGetMainBundleAlreadyLocked(); pthread_mutex_unlock(&CFBundleGlobalDataLock); return mainBundle; } CFBundleRef CFBundleGetBundleWithIdentifier(CFStringRef bundleID) { CFBundleRef result = NULL; if (bundleID) { pthread_mutex_lock(&CFBundleGlobalDataLock); (void)_CFBundleGetMainBundleAlreadyLocked(); result = _CFBundlePrimitiveGetBundleWithIdentifierAlreadyLocked(bundleID); #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI if (!result) { // Try to create the bundle for the caller and try again void *p = __builtin_return_address(0); if (p) { CFStringRef imagePath = _CFBundleCopyLoadedImagePathForPointer(p); if (imagePath) { _CFBundleEnsureBundleExistsForImagePath(imagePath); CFRelease(imagePath); } result = _CFBundlePrimitiveGetBundleWithIdentifierAlreadyLocked(bundleID); } } #endif if (!result) { // Try to guess the bundle from the identifier and try again _CFBundleEnsureBundlesUpToDateWithHintAlreadyLocked(bundleID); result = _CFBundlePrimitiveGetBundleWithIdentifierAlreadyLocked(bundleID); } pthread_mutex_unlock(&CFBundleGlobalDataLock); } if (!result) { pthread_mutex_lock(&CFBundleGlobalDataLock); // Make sure all bundles have been created and try again. _CFBundleEnsureAllBundlesUpToDateAlreadyLocked(); result = _CFBundlePrimitiveGetBundleWithIdentifierAlreadyLocked(bundleID); pthread_mutex_unlock(&CFBundleGlobalDataLock); } return result; } static CFStringRef __CFBundleCopyDescription(CFTypeRef cf) { char buff[CFMaxPathSize]; CFStringRef path = NULL, binaryType = NULL, retval = NULL; if (((CFBundleRef)cf)->_url && CFURLGetFileSystemRepresentation(((CFBundleRef)cf)->_url, true, (uint8_t *)buff, CFMaxPathSize)) path = CFStringCreateWithFileSystemRepresentation(kCFAllocatorSystemDefault, buff); switch (((CFBundleRef)cf)->_binaryType) { case __CFBundleCFMBinary: binaryType = CFSTR(""); break; case __CFBundleDYLDExecutableBinary: binaryType = CFSTR("executable, "); break; case __CFBundleDYLDBundleBinary: binaryType = CFSTR("bundle, "); break; case __CFBundleDYLDFrameworkBinary: binaryType = CFSTR("framework, "); break; case __CFBundleDLLBinary: binaryType = CFSTR("DLL, "); break; case __CFBundleUnreadableBinary: binaryType = CFSTR(""); break; default: binaryType = CFSTR(""); break; } if (((CFBundleRef)cf)->_plugInData._isPlugIn) { retval = CFStringCreateWithFormat(kCFAllocatorSystemDefault, NULL, CFSTR("CFBundle/CFPlugIn %p <%@> (%@%@loaded)"), cf, path, binaryType, ((CFBundleRef)cf)->_isLoaded ? CFSTR("") : CFSTR("not ")); } else { retval = CFStringCreateWithFormat(kCFAllocatorSystemDefault, NULL, CFSTR("CFBundle %p <%@> (%@%@loaded)"), cf, path, binaryType, ((CFBundleRef)cf)->_isLoaded ? CFSTR("") : CFSTR("not ")); } if (path) CFRelease(path); return retval; } static void _CFBundleDeallocateGlue(const void *key, const void *value, void *context) { CFAllocatorRef allocator = (CFAllocatorRef)context; if (value) CFAllocatorDeallocate(allocator, (void *)value); } static void __CFBundleDeallocate(CFTypeRef cf) { CFBundleRef bundle = (CFBundleRef)cf; CFURLRef bundleURL; CFStringRef bundleID = NULL; __CFGenericValidateType(cf, CFBundleGetTypeID()); bundleURL = bundle->_url; bundle->_url = NULL; if (bundle->_infoDict) bundleID = (CFStringRef)CFDictionaryGetValue(bundle->_infoDict, kCFBundleIdentifierKey); _CFBundleRemoveFromTables(bundle, bundleURL, bundleID); CFBundleUnloadExecutable(bundle); _CFBundleDeallocatePlugIn(bundle); if (bundleURL) { CFRelease(bundleURL); } if (bundle->_infoDict) CFRelease(bundle->_infoDict); if (bundle->_modDate) CFRelease(bundle->_modDate); if (bundle->_localInfoDict) CFRelease(bundle->_localInfoDict); if (bundle->_searchLanguages) CFRelease(bundle->_searchLanguages); if (bundle->_executablePath) CFRelease(bundle->_executablePath); if (bundle->_developmentRegion) CFRelease(bundle->_developmentRegion); if (bundle->_infoPlistUrl) CFRelease(bundle->_infoPlistUrl); if (bundle->_glueDict) { CFDictionaryApplyFunction(bundle->_glueDict, _CFBundleDeallocateGlue, (void *)CFGetAllocator(bundle)); CFRelease(bundle->_glueDict); } if (bundle->_stringTable) CFRelease(bundle->_stringTable); if (bundle->_bundleBasePath) CFRelease(bundle->_bundleBasePath); if (bundle->_queryTable) CFRelease(bundle->_queryTable); if (bundle->_localizations) CFRelease(bundle->_localizations); if (bundle->_resourceDirectoryContents) CFRelease(bundle->_resourceDirectoryContents); if (bundle->_additionalResourceBundles) CFRelease(bundle->_additionalResourceBundles); pthread_mutex_destroy(&(bundle->_bundleLoadingLock)); } static const CFRuntimeClass __CFBundleClass = { _kCFRuntimeScannedObject, "CFBundle", NULL, // init NULL, // copy __CFBundleDeallocate, NULL, // equal NULL, // hash NULL, // __CFBundleCopyDescription }; // From CFBundle_Resources.c CF_PRIVATE void _CFBundleResourcesInitialize(void); CFTypeID CFBundleGetTypeID(void) { static dispatch_once_t initOnce; dispatch_once(&initOnce, ^{ __kCFBundleTypeID = _CFRuntimeRegisterClass(&__CFBundleClass); _CFBundleResourcesInitialize(); }); return __kCFBundleTypeID; } CFBundleRef _CFBundleGetExistingBundleWithBundleURL(CFURLRef bundleURL) { CFBundleRef bundle = NULL; char buff[CFMaxPathSize]; CFURLRef newURL = NULL; if (!CFURLGetFileSystemRepresentation(bundleURL, true, (uint8_t *)buff, CFMaxPathSize)) return NULL; newURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorSystemDefault, (uint8_t *)buff, strlen(buff), true); if (!newURL) newURL = (CFURLRef)CFRetain(bundleURL); bundle = _CFBundleCopyBundleForURL(newURL, false); if (bundle) CFRelease(bundle); CFRelease(newURL); return bundle; } static CFBundleRef _CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL, Boolean alreadyLocked, Boolean doFinalProcessing, Boolean unique) { CFBundleRef bundle = NULL; char buff[CFMaxPathSize]; CFDateRef modDate = NULL; // do not actually fetch the modDate, since that can cause something like 7609956, unless absolutely found to be necessary in the future Boolean exists = false; SInt32 mode = 0; CFURLRef newURL = NULL; uint8_t localVersion = 0; if (!CFURLGetFileSystemRepresentation(bundleURL, true, (uint8_t *)buff, CFMaxPathSize)) return NULL; newURL = CFURLCreateFromFileSystemRepresentation(allocator, (uint8_t *)buff, strlen(buff), true); if (!newURL) newURL = (CFURLRef)CFRetain(bundleURL); if (!unique) { bundle = _CFBundleCopyBundleForURL(newURL, alreadyLocked); if (bundle) { CFRelease(newURL); return bundle; } } localVersion = _CFBundleGetBundleVersionForURL(newURL); if (localVersion == 3) { SInt32 res = _CFGetPathProperties(allocator, (char *)buff, &exists, &mode, NULL, NULL, NULL, NULL); #if DEPLOYMENT_TARGET_WINDOWS if (!(res == 0 && exists && ((mode & S_IFMT) == S_IFDIR))) { // 2nd chance at finding a bundle path - remove the last path component (e.g., mybundle.resources) and try again if (modDate) { CFRelease(modDate); modDate = NULL; } CFURLRef shorterPath = CFURLCreateCopyDeletingLastPathComponent(allocator, newURL); CFRelease(newURL); newURL = shorterPath; res = _CFGetFileProperties(allocator, newURL, &exists, &mode, NULL, NULL, NULL, NULL); } #endif if (res == 0) { if (!exists || ((mode & S_IFMT) != S_IFDIR)) { if (modDate) CFRelease(modDate); CFRelease(newURL); return NULL; } } else { CFRelease(newURL); return NULL; } } bundle = (CFBundleRef)_CFRuntimeCreateInstance(allocator, CFBundleGetTypeID(), sizeof(struct __CFBundle) - sizeof(CFRuntimeBase), NULL); if (!bundle) { CFRelease(newURL); return NULL; } bundle->_url = newURL; bundle->_modDate = modDate; bundle->_version = localVersion; bundle->_infoDict = NULL; bundle->_localInfoDict = NULL; bundle->_searchLanguages = NULL; bundle->_executablePath = NULL; bundle->_developmentRegion = NULL; bundle->_infoPlistUrl = NULL; bundle->_developmentRegionCalculated = 0; #if defined(BINARY_SUPPORT_DYLD) /* We'll have to figure it out later */ bundle->_binaryType = __CFBundleUnknownBinary; #elif defined(BINARY_SUPPORT_DLL) /* We support DLL only */ bundle->_binaryType = __CFBundleDLLBinary; bundle->_hModule = NULL; #else /* We'll have to figure it out later */ bundle->_binaryType = __CFBundleUnknownBinary; #endif /* BINARY_SUPPORT_DYLD */ bundle->_isLoaded = false; bundle->_sharesStringsFiles = false; bundle->_isUnique = unique; #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI if (!__CFgetenv("CFBundleDisableStringsSharing") && (strncmp(buff, "/System/Library/Frameworks", 26) == 0) && (strncmp(buff + strlen(buff) - 10, ".framework", 10) == 0)) bundle->_sharesStringsFiles = true; #endif bundle->_connectionCookie = NULL; bundle->_handleCookie = NULL; bundle->_imageCookie = NULL; bundle->_moduleCookie = NULL; bundle->_glueDict = NULL; bundle->_resourceData._executableLacksResourceFork = false; bundle->_resourceData._infoDictionaryFromResourceFork = false; bundle->_stringTable = NULL; bundle->_plugInData._isPlugIn = false; bundle->_plugInData._loadOnDemand = false; bundle->_plugInData._isDoingDynamicRegistration = false; bundle->_plugInData._instanceCount = 0; bundle->_plugInData._factories = NULL; pthread_mutexattr_t mattr; pthread_mutexattr_init(&mattr); pthread_mutexattr_settype(&mattr, PTHREAD_MUTEX_DEFAULT); int32_t mret = pthread_mutex_init(&(bundle->_bundleLoadingLock), &mattr); pthread_mutexattr_destroy(&mattr); if (0 != mret) { CFLog(4, CFSTR("%s: failed to initialize bundle loading lock for bundle %@."), __PRETTY_FUNCTION__, bundle); } bundle->_lock = CFLockInit; bundle->_resourceDirectoryContents = NULL; bundle->_localizations = NULL; bundle->_lookedForLocalizations = false; bundle->_queryLock = CFLockInit; bundle->_queryTable = NULL; CFURLRef absoURL = CFURLCopyAbsoluteURL(bundle->_url); bundle->_bundleBasePath = CFURLCopyFileSystemPath(absoURL, PLATFORM_PATH_STYLE); CFRelease(absoURL); bundle->_additionalResourceLock = CFLockInit; bundle->_additionalResourceBundles = NULL; CFBundleGetInfoDictionary(bundle); // Do this so that we can use the dispatch_once on the ivar of this bundle safely OSMemoryBarrier(); _CFBundleAddToTables(bundle, alreadyLocked); if (doFinalProcessing) { if (_CFBundleNeedsInitPlugIn(bundle)) { if (alreadyLocked) pthread_mutex_unlock(&CFBundleGlobalDataLock); _CFBundleInitPlugIn(bundle); if (alreadyLocked) pthread_mutex_lock(&CFBundleGlobalDataLock); } } return bundle; } CFBundleRef CFBundleCreate(CFAllocatorRef allocator, CFURLRef bundleURL) { return _CFBundleCreate(allocator, bundleURL, false, true, false); } CFBundleRef _CFBundleCreateUnique(CFAllocatorRef allocator, CFURLRef bundleURL) { // This function can never return an existing CFBundleRef object. return _CFBundleCreate(allocator, bundleURL, false, true, true); } CFArrayRef CFBundleCreateBundlesFromDirectory(CFAllocatorRef alloc, CFURLRef directoryURL, CFStringRef bundleType) { CFMutableArrayRef bundles = CFArrayCreateMutable(alloc, 0, &kCFTypeArrayCallBacks); CFArrayRef URLs = _CFCreateContentsOfDirectory(alloc, NULL, NULL, directoryURL, bundleType); if (URLs) { CFIndex i, c = CFArrayGetCount(URLs); CFURLRef curURL; CFBundleRef curBundle; for (i = 0; i < c; i++) { curURL = (CFURLRef)CFArrayGetValueAtIndex(URLs, i); curBundle = CFBundleCreate(alloc, curURL); if (curBundle) CFArrayAppendValue(bundles, curBundle); } CFRelease(URLs); } return bundles; } CFURLRef CFBundleCopyBundleURL(CFBundleRef bundle) { if (bundle->_url) CFRetain(bundle->_url); return bundle->_url; } #define DEVELOPMENT_STAGE 0x20 #define ALPHA_STAGE 0x40 #define BETA_STAGE 0x60 #define RELEASE_STAGE 0x80 #define MAX_VERS_LEN 10 CF_INLINE Boolean _isDigit(UniChar aChar) {return ((aChar >= (UniChar)'0' && aChar <= (UniChar)'9') ? true : false);} CF_PRIVATE CFStringRef _CFCreateStringFromVersionNumber(CFAllocatorRef alloc, UInt32 vers) { CFStringRef result = NULL; uint8_t major1, major2, minor1, minor2, stage, build; major1 = (vers & 0xF0000000) >> 28; major2 = (vers & 0x0F000000) >> 24; minor1 = (vers & 0x00F00000) >> 20; minor2 = (vers & 0x000F0000) >> 16; stage = (vers & 0x0000FF00) >> 8; build = (vers & 0x000000FF); if (stage == RELEASE_STAGE) { if (major1 > 0) { result = CFStringCreateWithFormat(alloc, NULL, CFSTR("%d%d.%d.%d"), major1, major2, minor1, minor2); } else { result = CFStringCreateWithFormat(alloc, NULL, CFSTR("%d.%d.%d"), major2, minor1, minor2); } } else { if (major1 > 0) { result = CFStringCreateWithFormat(alloc, NULL, CFSTR("%d%d.%d.%d%c%d"), major1, major2, minor1, minor2, ((stage == DEVELOPMENT_STAGE) ? 'd' : ((stage == ALPHA_STAGE) ? 'a' : 'b')), build); } else { result = CFStringCreateWithFormat(alloc, NULL, CFSTR("%d.%d.%d%c%d"), major2, minor1, minor2, ((stage == DEVELOPMENT_STAGE) ? 'd' : ((stage == ALPHA_STAGE) ? 'a' : 'b')), build); } } return result; } CF_PRIVATE UInt32 _CFVersionNumberFromString(CFStringRef versStr) { // Parse version number from string. // String can begin with "." for major version number 0. String can end at any point, but elements within the string cannot be skipped. UInt32 major1 = 0, major2 = 0, minor1 = 0, minor2 = 0, stage = RELEASE_STAGE, build = 0; UniChar versChars[MAX_VERS_LEN]; UniChar *chars = NULL; CFIndex len; UInt32 theVers; Boolean digitsDone = false; if (!versStr) return 0; len = CFStringGetLength(versStr); if (len <= 0 || len > MAX_VERS_LEN) return 0; CFStringGetCharacters(versStr, CFRangeMake(0, len), versChars); chars = versChars; // Get major version number. major1 = major2 = 0; if (_isDigit(*chars)) { major2 = *chars - (UniChar)'0'; chars++; len--; if (len > 0) { if (_isDigit(*chars)) { major1 = major2; major2 = *chars - (UniChar)'0'; chars++; len--; if (len > 0) { if (*chars == (UniChar)'.') { chars++; len--; } else { digitsDone = true; } } } else if (*chars == (UniChar)'.') { chars++; len--; } else { digitsDone = true; } } } else if (*chars == (UniChar)'.') { chars++; len--; } else { digitsDone = true; } // Now major1 and major2 contain first and second digit of the major version number as ints. // Now either len is 0 or chars points at the first char beyond the first decimal point. // Get the first minor version number. if (len > 0 && !digitsDone) { if (_isDigit(*chars)) { minor1 = *chars - (UniChar)'0'; chars++; len--; if (len > 0) { if (*chars == (UniChar)'.') { chars++; len--; } else { digitsDone = true; } } } else { digitsDone = true; } } // Now minor1 contains the first minor version number as an int. // Now either len is 0 or chars points at the first char beyond the second decimal point. // Get the second minor version number. if (len > 0 && !digitsDone) { if (_isDigit(*chars)) { minor2 = *chars - (UniChar)'0'; chars++; len--; } else { digitsDone = true; } } // Now minor2 contains the second minor version number as an int. // Now either len is 0 or chars points at the build stage letter. // Get the build stage letter. We must find 'd', 'a', 'b', or 'f' next, if there is anything next. if (len > 0) { if (*chars == (UniChar)'d') { stage = DEVELOPMENT_STAGE; } else if (*chars == (UniChar)'a') { stage = ALPHA_STAGE; } else if (*chars == (UniChar)'b') { stage = BETA_STAGE; } else if (*chars == (UniChar)'f') { stage = RELEASE_STAGE; } else { return 0; } chars++; len--; } // Now stage contains the release stage. // Now either len is 0 or chars points at the build number. // Get the first digit of the build number. if (len > 0) { if (_isDigit(*chars)) { build = *chars - (UniChar)'0'; chars++; len--; } else { return 0; } } // Get the second digit of the build number. if (len > 0) { if (_isDigit(*chars)) { build *= 10; build += *chars - (UniChar)'0'; chars++; len--; } else { return 0; } } // Get the third digit of the build number. if (len > 0) { if (_isDigit(*chars)) { build *= 10; build += *chars - (UniChar)'0'; chars++; len--; } else { return 0; } } // Range check the build number and make sure we exhausted the string. if (build > 0xFF || len > 0) return 0; // Build the number theVers = major1 << 28; theVers += major2 << 24; theVers += minor1 << 20; theVers += minor2 << 16; theVers += stage << 8; theVers += build; return theVers; } UInt32 CFBundleGetVersionNumber(CFBundleRef bundle) { CFDictionaryRef infoDict = CFBundleGetInfoDictionary(bundle); CFNumberRef versionValue = (CFNumberRef)CFDictionaryGetValue(infoDict, _kCFBundleNumericVersionKey); if (!versionValue || CFGetTypeID(versionValue) != CFNumberGetTypeID()) return 0; UInt32 vers = 0; CFNumberGetValue(versionValue, kCFNumberSInt32Type, &vers); return vers; } CFStringRef CFBundleGetDevelopmentRegion(CFBundleRef bundle) { dispatch_once(&bundle->_developmentRegionCalculated, ^{ CFStringRef devRegion = NULL; CFDictionaryRef infoDict = CFBundleGetInfoDictionary(bundle); if (infoDict) { devRegion = (CFStringRef)CFDictionaryGetValue(infoDict, kCFBundleDevelopmentRegionKey); if (devRegion && (CFGetTypeID(devRegion) != CFStringGetTypeID() || CFStringGetLength(devRegion) == 0)) { devRegion = NULL; } } if (devRegion) bundle->_developmentRegion = (CFStringRef)CFRetain(devRegion); }); return bundle->_developmentRegion; } Boolean _CFBundleGetHasChanged(CFBundleRef bundle) { CFDateRef modDate; Boolean result = false; Boolean exists = false; SInt32 mode = 0; if (_CFGetFileProperties(CFGetAllocator(bundle), bundle->_url, &exists, &mode, NULL, &modDate, NULL, NULL) == 0) { // If the bundle no longer exists or is not a folder, it must have "changed" if (!exists || ((mode & S_IFMT) != S_IFDIR)) result = true; } else { // Something is wrong. The stat failed. result = true; } if (bundle->_modDate && !CFEqual(bundle->_modDate, modDate)) { // mod date is different from when we created. result = true; } CFRelease(modDate); return result; } void _CFBundleSetStringsFilesShared(CFBundleRef bundle, Boolean flag) { bundle->_sharesStringsFiles = flag; } Boolean _CFBundleGetStringsFilesShared(CFBundleRef bundle) { return bundle->_sharesStringsFiles; } static Boolean _urlExists(CFURLRef url) { Boolean exists; return url && (0 == _CFGetFileProperties(kCFAllocatorSystemDefault, url, &exists, NULL, NULL, NULL, NULL, NULL)) && exists; } // This is here because on iPhoneOS with the dyld shared cache, we remove binaries from their // original locations on disk, so checking whether a binary's path exists is no longer sufficient. // For performance reasons, we only call dlopen_preflight() after we've verified that the binary // does not exist at its original path with _urlExists(). // See <rdar://problem/6956670> static Boolean _binaryLoadable(CFURLRef url) { Boolean loadable = _urlExists(url); #if DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI if (!loadable) { uint8_t path[PATH_MAX]; if (url && CFURLGetFileSystemRepresentation(url, true, path, sizeof(path))) { loadable = dlopen_preflight((char *)path); } } #endif return loadable; } CF_PRIVATE CFURLRef _CFBundleCopySupportFilesDirectoryURLInDirectory(CFURLRef bundleURL, uint8_t version) { CFURLRef result = NULL; if (bundleURL) { if (1 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleSupportFilesURLFromBase1, bundleURL); } else if (2 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleSupportFilesURLFromBase2, bundleURL); } else { result = (CFURLRef)CFRetain(bundleURL); } } return result; } CF_EXPORT CFURLRef CFBundleCopySupportFilesDirectoryURL(CFBundleRef bundle) { return _CFBundleCopySupportFilesDirectoryURLInDirectory(bundle->_url, bundle->_version); } CF_PRIVATE CFURLRef _CFBundleCopyResourcesDirectoryURLInDirectory(CFURLRef bundleURL, uint8_t version) { CFURLRef result = NULL; if (bundleURL) { if (0 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleResourcesURLFromBase0, bundleURL); } else if (1 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleResourcesURLFromBase1, bundleURL); } else if (2 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleResourcesURLFromBase2, bundleURL); } else { result = (CFURLRef)CFRetain(bundleURL); } } return result; } CF_EXPORT CFURLRef CFBundleCopyResourcesDirectoryURL(CFBundleRef bundle) { return _CFBundleCopyResourcesDirectoryURLInDirectory(bundle->_url, bundle->_version); } CF_PRIVATE CFURLRef _CFBundleCopyAppStoreReceiptURLInDirectory(CFURLRef bundleURL, uint8_t version) { CFURLRef result = NULL; if (bundleURL) { if (0 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleAppStoreReceiptURLFromBase0, bundleURL); } else if (1 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleAppStoreReceiptURLFromBase1, bundleURL); } else if (2 == version) { result = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleAppStoreReceiptURLFromBase2, bundleURL); } } return result; } CFURLRef _CFBundleCopyAppStoreReceiptURL(CFBundleRef bundle) { return _CFBundleCopyAppStoreReceiptURLInDirectory(bundle->_url, bundle->_version); } static CFURLRef _CFBundleCopyExecutableURLRaw(CFURLRef urlPath, CFStringRef exeName) { // Given an url to a folder and a name, this returns the url to the executable in that folder with that name, if it exists, and NULL otherwise. This function deals with appending the ".exe" or ".dll" on Windows. CFURLRef executableURL = NULL; if (!urlPath || !exeName) return NULL; #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI const uint8_t *image_suffix = (uint8_t *)__CFgetenvIfNotRestricted("DYLD_IMAGE_SUFFIX"); if (image_suffix) { CFStringRef newExeName, imageSuffix; imageSuffix = CFStringCreateWithCString(kCFAllocatorSystemDefault, (char *)image_suffix, kCFStringEncodingUTF8); if (CFStringHasSuffix(exeName, CFSTR(".dylib"))) { CFStringRef bareExeName = CFStringCreateWithSubstring(kCFAllocatorSystemDefault, exeName, CFRangeMake(0, CFStringGetLength(exeName)-6)); newExeName = CFStringCreateWithFormat(kCFAllocatorSystemDefault, NULL, CFSTR("%@%@.dylib"), exeName, imageSuffix); CFRelease(bareExeName); } else { newExeName = CFStringCreateWithFormat(kCFAllocatorSystemDefault, NULL, CFSTR("%@%@"), exeName, imageSuffix); } executableURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, newExeName, kCFURLPOSIXPathStyle, false, urlPath); if (executableURL && !_binaryLoadable(executableURL)) { CFRelease(executableURL); executableURL = NULL; } CFRelease(newExeName); CFRelease(imageSuffix); } if (!executableURL) { executableURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, exeName, kCFURLPOSIXPathStyle, false, urlPath); if (executableURL && !_binaryLoadable(executableURL)) { CFRelease(executableURL); executableURL = NULL; } } #elif DEPLOYMENT_TARGET_WINDOWS if (!executableURL) { executableURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, exeName, kCFURLWindowsPathStyle, false, urlPath); if (executableURL && !_urlExists(executableURL)) { CFRelease(executableURL); executableURL = NULL; } } if (!executableURL) { if (!CFStringFindWithOptions(exeName, CFSTR(".dll"), CFRangeMake(0, CFStringGetLength(exeName)), kCFCompareAnchored|kCFCompareBackwards|kCFCompareCaseInsensitive, NULL)) { #if defined(DEBUG) CFStringRef extension = CFSTR("_debug.dll"); #else CFStringRef extension = CFSTR(".dll"); #endif CFStringRef newExeName = CFStringCreateWithFormat(kCFAllocatorSystemDefault, NULL, CFSTR("%@%@"), exeName, extension); executableURL = CFURLCreateWithString(kCFAllocatorSystemDefault, newExeName, urlPath); if (executableURL && !_binaryLoadable(executableURL)) { CFRelease(executableURL); executableURL = NULL; } CFRelease(newExeName); } } if (!executableURL) { if (!CFStringFindWithOptions(exeName, CFSTR(".exe"), CFRangeMake(0, CFStringGetLength(exeName)), kCFCompareAnchored|kCFCompareBackwards|kCFCompareCaseInsensitive, NULL)) { #if defined(DEBUG) CFStringRef extension = CFSTR("_debug.exe"); #else CFStringRef extension = CFSTR(".exe"); #endif CFStringRef newExeName = CFStringCreateWithFormat(kCFAllocatorSystemDefault, NULL, CFSTR("%@%@"), exeName, extension); executableURL = CFURLCreateWithString(kCFAllocatorSystemDefault, newExeName, urlPath); if (executableURL && !_binaryLoadable(executableURL)) { CFRelease(executableURL); executableURL = NULL; } CFRelease(newExeName); } } #endif return executableURL; } CF_PRIVATE CFStringRef _CFBundleCopyExecutableName(CFBundleRef bundle, CFURLRef url, CFDictionaryRef infoDict) { CFStringRef executableName = NULL; if (!infoDict && bundle) infoDict = CFBundleGetInfoDictionary(bundle); if (!url && bundle) url = bundle->_url; if (infoDict) { // Figure out the name of the executable. // First try for the new key in the plist. executableName = (CFStringRef)CFDictionaryGetValue(infoDict, kCFBundleExecutableKey); // Second try for the old key in the plist. if (!executableName) executableName = (CFStringRef)CFDictionaryGetValue(infoDict, _kCFBundleOldExecutableKey); if (executableName && CFGetTypeID(executableName) == CFStringGetTypeID() && CFStringGetLength(executableName) > 0) { CFRetain(executableName); } else { executableName = NULL; } } if (!executableName && url) { // Third, take the name of the bundle itself (with path extension stripped) CFURLRef absoluteURL = CFURLCopyAbsoluteURL(url); CFStringRef bundlePath = CFURLCopyFileSystemPath(absoluteURL, PLATFORM_PATH_STYLE); CFRelease(absoluteURL); if (bundlePath) { CFIndex len = CFStringGetLength(bundlePath); CFIndex startOfBundleName = _CFStartOfLastPathComponent2(bundlePath); CFIndex endOfBundleName = _CFLengthAfterDeletingPathExtension2(bundlePath); if (startOfBundleName <= len && endOfBundleName <= len && startOfBundleName < endOfBundleName) { executableName = CFStringCreateWithSubstring(kCFAllocatorSystemDefault, bundlePath, CFRangeMake(startOfBundleName, endOfBundleName - startOfBundleName)); } CFRelease(bundlePath); } } return executableName; } static CFURLRef _CFBundleCopyExecutableURLInDirectory2(CFBundleRef bundle, CFURLRef url, CFStringRef executableName, Boolean ignoreCache, Boolean useOtherPlatform) { uint8_t version = 0; CFDictionaryRef infoDict = NULL; CFStringRef executablePath = NULL; CFURLRef executableURL = NULL; Boolean foundIt = false; Boolean lookupMainExe = (executableName ? false : true); if (bundle) { infoDict = CFBundleGetInfoDictionary(bundle); version = bundle->_version; } else { infoDict = _CFBundleCopyInfoDictionaryInDirectory(kCFAllocatorSystemDefault, url, &version); } // If we have a bundle instance and an info dict, see if we have already cached the path if (lookupMainExe && !ignoreCache && !useOtherPlatform && bundle && bundle->_executablePath) { __CFLock(&bundle->_lock); executablePath = bundle->_executablePath; if (executablePath) CFRetain(executablePath); __CFUnlock(&bundle->_lock); if (executablePath) { #if DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI executableURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, executablePath, kCFURLPOSIXPathStyle, false); #elif DEPLOYMENT_TARGET_WINDOWS executableURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, executablePath, kCFURLWindowsPathStyle, false); #endif if (executableURL) { foundIt = true; } CFRelease(executablePath); } } if (!foundIt) { if (lookupMainExe) executableName = _CFBundleCopyExecutableName(bundle, url, infoDict); if (executableName) { #if (DEPLOYMENT_TARGET_EMBEDDED && !TARGET_IPHONE_SIMULATOR) Boolean doExecSearch = false; #else Boolean doExecSearch = true; #endif // Now, look for the executable inside the bundle. if (doExecSearch && 0 != version) { CFURLRef exeDirURL = NULL; CFURLRef exeSubdirURL; if (1 == version) { exeDirURL = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleExecutablesURLFromBase1, url); } else if (2 == version) { exeDirURL = CFURLCreateWithString(kCFAllocatorSystemDefault, _CFBundleExecutablesURLFromBase2, url); } else { #if DEPLOYMENT_TARGET_WINDOWS // On Windows, if the bundle URL is foo.resources, then the executable is at the same level as the .resources directory CFStringRef extension = CFURLCopyPathExtension(url); if (extension && CFEqual(extension, _CFBundleWindowsResourceDirectoryExtension)) { exeDirURL = CFURLCreateCopyDeletingLastPathComponent(kCFAllocatorSystemDefault, url); } else { exeDirURL = (CFURLRef)CFRetain(url); } #else exeDirURL = (CFURLRef)CFRetain(url); #endif } CFStringRef platformSubDir = useOtherPlatform ? _CFBundleGetOtherPlatformExecutablesSubdirectoryName() : _CFBundleGetPlatformExecutablesSubdirectoryName(); exeSubdirURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, platformSubDir, kCFURLPOSIXPathStyle, true, exeDirURL); executableURL = _CFBundleCopyExecutableURLRaw(exeSubdirURL, executableName); if (!executableURL) { CFRelease(exeSubdirURL); platformSubDir = useOtherPlatform ? _CFBundleGetOtherAlternatePlatformExecutablesSubdirectoryName() : _CFBundleGetAlternatePlatformExecutablesSubdirectoryName(); exeSubdirURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, platformSubDir, kCFURLPOSIXPathStyle, true, exeDirURL); executableURL = _CFBundleCopyExecutableURLRaw(exeSubdirURL, executableName); } if (!executableURL) { CFRelease(exeSubdirURL); platformSubDir = useOtherPlatform ? _CFBundleGetPlatformExecutablesSubdirectoryName() : _CFBundleGetOtherPlatformExecutablesSubdirectoryName(); exeSubdirURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, platformSubDir, kCFURLPOSIXPathStyle, true, exeDirURL); executableURL = _CFBundleCopyExecutableURLRaw(exeSubdirURL, executableName); } if (!executableURL) { CFRelease(exeSubdirURL); platformSubDir = useOtherPlatform ? _CFBundleGetAlternatePlatformExecutablesSubdirectoryName() : _CFBundleGetOtherAlternatePlatformExecutablesSubdirectoryName(); exeSubdirURL = CFURLCreateWithFileSystemPathRelativeToBase(kCFAllocatorSystemDefault, platformSubDir, kCFURLPOSIXPathStyle, true, exeDirURL); executableURL = _CFBundleCopyExecutableURLRaw(exeSubdirURL, executableName); } if (!executableURL) executableURL = _CFBundleCopyExecutableURLRaw(exeDirURL, executableName); CFRelease(exeDirURL); CFRelease(exeSubdirURL); } // If this was an old bundle, or we did not find the executable in the Executables subdirectory, look directly in the bundle wrapper. if (!executableURL) executableURL = _CFBundleCopyExecutableURLRaw(url, executableName); #if DEPLOYMENT_TARGET_WINDOWS // Windows only: If we still haven't found the exe, look in the Executables folder. // But only for the main bundle exe if (lookupMainExe && !executableURL) { CFURLRef exeDirURL = CFURLCreateWithString(kCFAllocatorSystemDefault, CFSTR("../../Executables"), url); executableURL = _CFBundleCopyExecutableURLRaw(exeDirURL, executableName); CFRelease(exeDirURL); } #endif if (lookupMainExe && !ignoreCache && !useOtherPlatform && bundle && executableURL) { // We found it. Cache the path. CFURLRef absURL = CFURLCopyAbsoluteURL(executableURL); #if DEPLOYMENT_TARGET_WINDOWS executablePath = CFURLCopyFileSystemPath(absURL, kCFURLWindowsPathStyle); #elif DEPLOYMENT_TARGET_MACOSX || DEPLOYMENT_TARGET_EMBEDDED || DEPLOYMENT_TARGET_EMBEDDED_MINI executablePath = CFURLCopyFileSystemPath(absURL, kCFURLPOSIXPathStyle); #endif CFRelease(absURL); __CFLock(&bundle->_lock); bundle->_executablePath = (CFStringRef)CFRetain(executablePath); __CFUnlock(&bundle->_lock); CFRelease(executablePath); } if (lookupMainExe && !useOtherPlatform && bundle && !executableURL) bundle->_binaryType = __CFBundleNoBinary; if (lookupMainExe) CFRelease(executableName); } } if (!bundle && infoDict) CFRelease(infoDict); return executableURL; } CFURLRef _CFBundleCopyExecutableURLInDirectory(CFURLRef url) { return _CFBundleCopyExecutableURLInDirectory2(NULL, url, NULL, true, false); } CFURLRef _CFBundleCopyOtherExecutableURLInDirectory(CFURLRef url) { return _CFBundleCopyExecutableURLInDirectory2(NULL, url, NULL, true, true); } CFURLRef CFBundleCopyExecutableURL(CFBundleRef bundle) { return _CFBundleCopyExecutableURLInDirectory2(bundle, bundle->_url, NULL, false, false); } static CFURLRef _CFBundleCopyExecutableURLIgnoringCache(CFBundleRef bundle) { return _CFBundleCopyExecutableURLInDirectory2(bundle, bundle->_url, NULL, true, false); } CFURLRef CFBundleCopyAuxiliaryExecutableURL(CFBundleRef bundle, CFStringRef executableName) { return _CFBundleCopyExecutableURLInDirectory2(bundle, bundle->_url, executableName, true, false); } Boolean CFBundleIsExecutableLoaded(CFBundleRef bundle) { return bundle->_isLoaded; } CFBundleExecutableType CFBundleGetExecutableType(CFBundleRef bundle) { CFBundleExecutableType result = kCFBundleOtherExecutableType; CFURLRef executableURL = CFBundleCopyExecutableURL(bundle); if (!executableURL) bundle->_binaryType = __CFBundleNoBinary; #if defined(BINARY_SUPPORT_DYLD) if (bundle->_binaryType == __CFBundleUnknownBinary) { bundle->_binaryType = _CFBundleGrokBinaryType(executableURL); if (bundle->_binaryType != __CFBundleCFMBinary && bundle->_binaryType != __CFBundleUnreadableBinary) bundle->_resourceData._executableLacksResourceFork = true; } #endif /* BINARY_SUPPORT_DYLD */ if (executableURL) CFRelease(executableURL); if (bundle->_binaryType == __CFBundleCFMBinary) { result = kCFBundlePEFExecutableType; } else if (bundle->_binaryType == __CFBundleDYLDExecutableBinary || bundle->_binaryType == __CFBundleDYLDBundleBinary || bundle->_binaryType == __CFBundleDYLDFrameworkBinary) { result = kCFBundleMachOExecutableType; } else if (bundle->_binaryType == __CFBundleDLLBinary) { result = kCFBundleDLLExecutableType; } else if (bundle->_binaryType == __CFBundleELFBinary) { result = kCFBundleELFExecutableType; } return result; } void _CFBundleSetCFMConnectionID(CFBundleRef bundle, void *connectionID) { bundle->_connectionCookie = connectionID; bundle->_isLoaded = true; } static CFStringRef _CFBundleCopyLastPathComponent(CFBundleRef bundle) { CFURLRef bundleURL = CFBundleCopyBundleURL(bundle); if (!bundleURL) { return CFSTR("<unknown>"); } CFStringRef str = CFURLCopyFileSystemPath(bundleURL, kCFURLPOSIXPathStyle); UniChar buff[CFMaxPathSize]; CFIndex buffLen = CFStringGetLength(str), startOfLastDir = 0; CFRelease(bundleURL); if (buffLen > CFMaxPathSize) buffLen = CFMaxPathSize; CFStringGetCharacters(str, CFRangeMake(0, buffLen), buff); CFRelease(str); if (buffLen > 0) startOfLastDir = _CFStartOfLastPathComponent(buff, buffLen); return CFStringCreateWithCharacters(kCFAllocatorSystemDefault, &(buff[startOfLastDir]), buffLen - startOfLastDir); } #pragma mark - CF_PRIVATE CFErrorRef _CFBundleCreateErrorDebug(CFAllocatorRef allocator, CFBundleRef bundle, CFIndex code, CFStringRef debugString) { const void *userInfoKeys[6], *userInfoValues[6]; CFIndex numKeys = 0; CFURLRef bundleURL = CFBundleCopyBundleURL(bundle), absoluteURL = CFURLCopyAbsoluteURL(bundleURL), executableURL = CFBundleCopyExecutableURL(bundle); CFBundleRef bdl = CFBundleGetBundleWithIdentifier(CFSTR("com.apple.CoreFoundation")); CFStringRef bundlePath = CFURLCopyFileSystemPath(absoluteURL, PLATFORM_PATH_STYLE), executablePath = executableURL ? CFURLCopyFileSystemPath(executableURL, PLATFORM_PATH_STYLE) : NULL, descFormat = NULL, desc = NULL, reason = NULL, suggestion = NULL; CFErrorRef error; if (bdl) { CFStringRef name = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(bundle, kCFBundleNameKey); name = name ? (CFStringRef)CFRetain(name) : _CFBundleCopyLastPathComponent(bundle); if (CFBundleExecutableNotFoundError == code) { descFormat = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr4"), CFSTR("Error"), bdl, CFSTR("The bundle \\U201c%@\\U201d couldn\\U2019t be loaded because its executable couldn\\U2019t be located."), "NSFileNoSuchFileError"); reason = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr4-C"), CFSTR("Error"), bdl, CFSTR("The bundle\\U2019s executable couldn\\U2019t be located."), "NSFileNoSuchFileError"); suggestion = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr4-R"), CFSTR("Error"), bdl, CFSTR("Try reinstalling the bundle."), "NSFileNoSuchFileError"); } else if (CFBundleExecutableNotLoadableError == code) { descFormat = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3584"), CFSTR("Error"), bdl, CFSTR("The bundle \\U201c%@\\U201d couldn\\U2019t be loaded because its executable isn\\U2019t loadable."), "NSExecutableNotLoadableError"); reason = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3584-C"), CFSTR("Error"), bdl, CFSTR("The bundle\\U2019s executable isn\\U2019t loadable."), "NSExecutableNotLoadableError"); suggestion = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3584-R"), CFSTR("Error"), bdl, CFSTR("Try reinstalling the bundle."), "NSExecutableNotLoadableError"); } else if (CFBundleExecutableArchitectureMismatchError == code) { descFormat = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3585"), CFSTR("Error"), bdl, CFSTR("The bundle \\U201c%@\\U201d couldn\\U2019t be loaded because it doesn\\U2019t contain a version for the current architecture."), "NSExecutableArchitectureMismatchError"); reason = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3585-C"), CFSTR("Error"), bdl, CFSTR("The bundle doesn\\U2019t contain a version for the current architecture."), "NSExecutableArchitectureMismatchError"); suggestion = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3585-R"), CFSTR("Error"), bdl, CFSTR("Try installing a universal version of the bundle."), "NSExecutableArchitectureMismatchError"); } else if (CFBundleExecutableRuntimeMismatchError == code) { descFormat = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3586"), CFSTR("Error"), bdl, CFSTR("The bundle \\U201c%@\\U201d couldn\\U2019t be loaded because it isn\\U2019t compatible with the current application."), "NSExecutableRuntimeMismatchError"); reason = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3586-C"), CFSTR("Error"), bdl, CFSTR("The bundle isn\\U2019t compatible with this application."), "NSExecutableRuntimeMismatchError"); suggestion = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3586-R"), CFSTR("Error"), bdl, CFSTR("Try installing a newer version of the bundle."), "NSExecutableRuntimeMismatchError"); } else if (CFBundleExecutableLoadError == code) { descFormat = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3587"), CFSTR("Error"), bdl, CFSTR("The bundle \\U201c%@\\U201d couldn\\U2019t be loaded because it is damaged or missing necessary resources."), "NSExecutableLoadError"); reason = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3587-C"), CFSTR("Error"), bdl, CFSTR("The bundle is damaged or missing necessary resources."), "NSExecutableLoadError"); suggestion = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3587-R"), CFSTR("Error"), bdl, CFSTR("Try reinstalling the bundle."), "NSExecutableLoadError"); } else if (CFBundleExecutableLinkError == code) { descFormat = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3588"), CFSTR("Error"), bdl, CFSTR("The bundle \\U201c%@\\U201d couldn\\U2019t be loaded."), "NSExecutableLinkError"); reason = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3588-C"), CFSTR("Error"), bdl, CFSTR("The bundle couldn\\U2019t be loaded."), "NSExecutableLinkError"); suggestion = CFCopyLocalizedStringWithDefaultValue(CFSTR("BundleErr3588-R"), CFSTR("Error"), bdl, CFSTR("Try reinstalling the bundle."), "NSExecutableLinkError"); } if (descFormat) { desc = CFStringCreateWithFormat(allocator, NULL, descFormat, name); CFRelease(descFormat); } CFRelease(name); } if (bundlePath) { userInfoKeys[numKeys] = CFSTR("NSBundlePath"); userInfoValues[numKeys] = bundlePath; numKeys++; } if (executablePath) { userInfoKeys[numKeys] = CFSTR("NSFilePath"); userInfoValues[numKeys] = executablePath; numKeys++; } if (desc) { userInfoKeys[numKeys] = kCFErrorLocalizedDescriptionKey; userInfoValues[numKeys] = desc; numKeys++; } if (reason) { userInfoKeys[numKeys] = kCFErrorLocalizedFailureReasonKey; userInfoValues[numKeys] = reason; numKeys++; } if (suggestion) { userInfoKeys[numKeys] = kCFErrorLocalizedRecoverySuggestionKey; userInfoValues[numKeys] = suggestion; numKeys++; } if (debugString) { userInfoKeys[numKeys] = CFSTR("NSDebugDescription"); userInfoValues[numKeys] = debugString; numKeys++; } error = CFErrorCreateWithUserInfoKeysAndValues(allocator, kCFErrorDomainCocoa, code, userInfoKeys, userInfoValues, numKeys); if (bundleURL) CFRelease(bundleURL); if (absoluteURL) CFRelease(absoluteURL); if (executableURL) CFRelease(executableURL); if (bundlePath) CFRelease(bundlePath); if (executablePath) CFRelease(executablePath); if (desc) CFRelease(desc); if (reason) CFRelease(reason); if (suggestion) CFRelease(suggestion); return error; } CFErrorRef _CFBundleCreateError(CFAllocatorRef allocator, CFBundleRef bundle, CFIndex code) { return _CFBundleCreateErrorDebug(allocator, bundle, code, NULL); } #pragma mark - Boolean _CFBundleLoadExecutableAndReturnError(CFBundleRef bundle, Boolean forceGlobal, CFErrorRef *error) { Boolean result = false; CFErrorRef localError = NULL, *subError = (error ? &localError : NULL); CFURLRef executableURL = CFBundleCopyExecutableURL(bundle); pthread_mutex_lock(&(bundle->_bundleLoadingLock)); if (!executableURL) bundle->_binaryType = __CFBundleNoBinary; // make sure we know whether bundle is already loaded or not #if defined(BINARY_SUPPORT_DLFCN) if (!bundle->_isLoaded) _CFBundleDlfcnCheckLoaded(bundle); #elif defined(BINARY_SUPPORT_DYLD) if (!bundle->_isLoaded) _CFBundleDYLDCheckLoaded(bundle); #endif /* BINARY_SUPPORT_DLFCN */ #if defined(BINARY_SUPPORT_DYLD) // We might need to figure out what it is if (bundle->_binaryType == __CFBundleUnknownBinary) { bundle->_binaryType = _CFBundleGrokBinaryType(executableURL); if (bundle->_binaryType != __CFBundleCFMBinary && bundle->_binaryType != __CFBundleUnreadableBinary) bundle->_resourceData._executableLacksResourceFork = true; } #endif /* BINARY_SUPPORT_DYLD */ if (executableURL) CFRelease(executableURL); if (bundle->_isLoaded) { pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); // Remove from the scheduled unload set if we are there. pthread_mutex_lock(&CFBundleGlobalDataLock); if (_bundlesToUnload) CFSetRemoveValue(_bundlesToUnload, bundle); pthread_mutex_unlock(&CFBundleGlobalDataLock); return true; } // Unload bundles scheduled for unloading if (!_scheduledBundlesAreUnloading) { pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); _CFBundleUnloadScheduledBundles(); pthread_mutex_lock(&(bundle->_bundleLoadingLock)); } if (bundle->_isLoaded) { pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); // Remove from the scheduled unload set if we are there. pthread_mutex_lock(&CFBundleGlobalDataLock); if (_bundlesToUnload) CFSetRemoveValue(_bundlesToUnload, bundle); pthread_mutex_unlock(&CFBundleGlobalDataLock); return true; } pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); switch (bundle->_binaryType) { #if defined(BINARY_SUPPORT_DLFCN) case __CFBundleUnreadableBinary: result = _CFBundleDlfcnLoadBundle(bundle, forceGlobal, subError); break; #endif /* BINARY_SUPPORT_DLFCN */ #if defined(BINARY_SUPPORT_DYLD) case __CFBundleDYLDBundleBinary: #if defined(BINARY_SUPPORT_DLFCN) result = _CFBundleDlfcnLoadBundle(bundle, forceGlobal, subError); #else /* BINARY_SUPPORT_DLFCN */ result = _CFBundleDYLDLoadBundle(bundle, forceGlobal, subError); #endif /* BINARY_SUPPORT_DLFCN */ break; case __CFBundleDYLDFrameworkBinary: #if defined(BINARY_SUPPORT_DLFCN) result = _CFBundleDlfcnLoadFramework(bundle, subError); #else /* BINARY_SUPPORT_DLFCN */ result = _CFBundleDYLDLoadFramework(bundle, subError); #endif /* BINARY_SUPPORT_DLFCN */ break; case __CFBundleDYLDExecutableBinary: if (error) { localError = _CFBundleCreateError(CFGetAllocator(bundle), bundle, CFBundleExecutableNotLoadableError); } else { CFLog(__kCFLogBundle, CFSTR("Attempt to load executable of a type that cannot be dynamically loaded for %@"), bundle); } break; #endif /* BINARY_SUPPORT_DYLD */ #if defined(BINARY_SUPPORT_DLFCN) case __CFBundleUnknownBinary: case __CFBundleELFBinary: result = _CFBundleDlfcnLoadBundle(bundle, forceGlobal, subError); break; #endif /* BINARY_SUPPORT_DLFCN */ #if defined(BINARY_SUPPORT_DLL) case __CFBundleDLLBinary: result = _CFBundleDLLLoad(bundle, subError); break; #endif /* BINARY_SUPPORT_DLL */ case __CFBundleNoBinary: if (error) { localError = _CFBundleCreateError(CFGetAllocator(bundle), bundle, CFBundleExecutableNotFoundError); } else { CFLog(__kCFLogBundle, CFSTR("Cannot find executable for %@"), bundle); } break; default: if (error) { localError = _CFBundleCreateError(CFGetAllocator(bundle), bundle, CFBundleExecutableNotLoadableError); } else { CFLog(__kCFLogBundle, CFSTR("Cannot recognize type of executable for %@"), bundle); } break; } if (result && bundle->_plugInData._isPlugIn) _CFBundlePlugInLoaded(bundle); if (!result && error) *error = localError; return result; } Boolean CFBundleLoadExecutableAndReturnError(CFBundleRef bundle, CFErrorRef *error) { return _CFBundleLoadExecutableAndReturnError(bundle, false, error); } Boolean CFBundleLoadExecutable(CFBundleRef bundle) { return _CFBundleLoadExecutableAndReturnError(bundle, false, NULL); } Boolean CFBundlePreflightExecutable(CFBundleRef bundle, CFErrorRef *error) { Boolean result = false; CFErrorRef localError = NULL; #if defined(BINARY_SUPPORT_DLFCN) CFErrorRef *subError = (error ? &localError : NULL); #endif CFURLRef executableURL = CFBundleCopyExecutableURL(bundle); pthread_mutex_lock(&(bundle->_bundleLoadingLock)); if (!executableURL) bundle->_binaryType = __CFBundleNoBinary; // make sure we know whether bundle is already loaded or not #if defined(BINARY_SUPPORT_DLFCN) if (!bundle->_isLoaded) _CFBundleDlfcnCheckLoaded(bundle); #elif defined(BINARY_SUPPORT_DYLD) if (!bundle->_isLoaded) _CFBundleDYLDCheckLoaded(bundle); #endif /* BINARY_SUPPORT_DLFCN */ #if defined(BINARY_SUPPORT_DYLD) // We might need to figure out what it is if (bundle->_binaryType == __CFBundleUnknownBinary) { bundle->_binaryType = _CFBundleGrokBinaryType(executableURL); if (bundle->_binaryType != __CFBundleCFMBinary && bundle->_binaryType != __CFBundleUnreadableBinary) bundle->_resourceData._executableLacksResourceFork = true; } #endif /* BINARY_SUPPORT_DYLD */ if (executableURL) CFRelease(executableURL); if (bundle->_isLoaded) { pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); return true; } pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); switch (bundle->_binaryType) { #if defined(BINARY_SUPPORT_DLFCN) case __CFBundleUnreadableBinary: result = _CFBundleDlfcnPreflight(bundle, subError); break; #endif /* BINARY_SUPPORT_DLFCN */ #if defined(BINARY_SUPPORT_DYLD) case __CFBundleDYLDBundleBinary: result = true; #if defined(BINARY_SUPPORT_DLFCN) result = _CFBundleDlfcnPreflight(bundle, subError); #endif /* BINARY_SUPPORT_DLFCN */ break; case __CFBundleDYLDFrameworkBinary: result = true; #if defined(BINARY_SUPPORT_DLFCN) result = _CFBundleDlfcnPreflight(bundle, subError); #endif /* BINARY_SUPPORT_DLFCN */ break; case __CFBundleDYLDExecutableBinary: if (error) localError = _CFBundleCreateError(CFGetAllocator(bundle), bundle, CFBundleExecutableNotLoadableError); break; #endif /* BINARY_SUPPORT_DYLD */ #if defined(BINARY_SUPPORT_DLFCN) case __CFBundleUnknownBinary: case __CFBundleELFBinary: result = _CFBundleDlfcnPreflight(bundle, subError); break; #endif /* BINARY_SUPPORT_DLFCN */ #if defined(BINARY_SUPPORT_DLL) case __CFBundleDLLBinary: result = true; break; #endif /* BINARY_SUPPORT_DLL */ case __CFBundleNoBinary: if (error) localError = _CFBundleCreateError(CFGetAllocator(bundle), bundle, CFBundleExecutableNotFoundError); break; default: if (error) localError = _CFBundleCreateError(CFGetAllocator(bundle), bundle, CFBundleExecutableNotLoadableError); break; } if (!result && error) *error = localError; return result; } CFArrayRef CFBundleCopyExecutableArchitectures(CFBundleRef bundle) { CFArrayRef result = NULL; CFURLRef executableURL = CFBundleCopyExecutableURL(bundle); if (executableURL) { result = _CFBundleCopyArchitecturesForExecutable(executableURL); CFRelease(executableURL); } return result; } void CFBundleUnloadExecutable(CFBundleRef bundle) { // First unload bundles scheduled for unloading (if that's not what we are already doing.) if (!_scheduledBundlesAreUnloading) _CFBundleUnloadScheduledBundles(); if (!bundle->_isLoaded) return; // Remove from the scheduled unload set if we are there. if (!_scheduledBundlesAreUnloading) pthread_mutex_lock(&CFBundleGlobalDataLock); if (_bundlesToUnload) CFSetRemoveValue(_bundlesToUnload, bundle); if (!_scheduledBundlesAreUnloading) pthread_mutex_unlock(&CFBundleGlobalDataLock); // Give the plugIn code a chance to realize this... _CFPlugInWillUnload(bundle); pthread_mutex_lock(&(bundle->_bundleLoadingLock)); if (!bundle->_isLoaded) { pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); return; } pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); switch (bundle->_binaryType) { #if defined(BINARY_SUPPORT_DYLD) case __CFBundleDYLDBundleBinary: #if defined(BINARY_SUPPORT_DLFCN) if (bundle->_handleCookie) _CFBundleDlfcnUnload(bundle); #else /* BINARY_SUPPORT_DLFCN */ _CFBundleDYLDUnloadBundle(bundle); #endif /* BINARY_SUPPORT_DLFCN */ break; case __CFBundleDYLDFrameworkBinary: #if defined(BINARY_SUPPORT_DLFCN) if (bundle->_handleCookie && _CFExecutableLinkedOnOrAfter(CFSystemVersionLeopard)) _CFBundleDlfcnUnload(bundle); #endif /* BINARY_SUPPORT_DLFCN */ break; #endif /* BINARY_SUPPORT_DYLD */ #if defined(BINARY_SUPPORT_DLL) case __CFBundleDLLBinary: _CFBundleDLLUnload(bundle); break; #endif /* BINARY_SUPPORT_DLL */ default: #if defined(BINARY_SUPPORT_DLFCN) if (bundle->_handleCookie) _CFBundleDlfcnUnload(bundle); #endif /* BINARY_SUPPORT_DLFCN */ break; } if (!bundle->_isLoaded && bundle->_glueDict) { CFDictionaryApplyFunction(bundle->_glueDict, _CFBundleDeallocateGlue, (void *)CFGetAllocator(bundle)); CFRelease(bundle->_glueDict); bundle->_glueDict = NULL; } } CF_PRIVATE void _CFBundleScheduleForUnloading(CFBundleRef bundle) { pthread_mutex_lock(&CFBundleGlobalDataLock); if (!_bundlesToUnload) { CFSetCallBacks nonRetainingCallbacks = kCFTypeSetCallBacks; nonRetainingCallbacks.retain = NULL; nonRetainingCallbacks.release = NULL; _bundlesToUnload = CFSetCreateMutable(kCFAllocatorSystemDefault, 0, &nonRetainingCallbacks); } CFSetAddValue(_bundlesToUnload, bundle); pthread_mutex_unlock(&CFBundleGlobalDataLock); } CF_PRIVATE void _CFBundleUnscheduleForUnloading(CFBundleRef bundle) { pthread_mutex_lock(&CFBundleGlobalDataLock); if (_bundlesToUnload) CFSetRemoveValue(_bundlesToUnload, bundle); pthread_mutex_unlock(&CFBundleGlobalDataLock); } CF_PRIVATE void _CFBundleUnloadScheduledBundles(void) { pthread_mutex_lock(&CFBundleGlobalDataLock); if (_bundlesToUnload) { CFIndex i, c = CFSetGetCount(_bundlesToUnload); if (c > 0) { CFBundleRef *unloadThese = (CFBundleRef *)CFAllocatorAllocate(kCFAllocatorSystemDefault, sizeof(CFBundleRef) * c, 0); CFSetGetValues(_bundlesToUnload, (const void **)unloadThese); _scheduledBundlesAreUnloading = true; for (i = 0; i < c; i++) { // This will cause them to be removed from the set. (Which is why we copied all the values out of the set up front.) CFBundleUnloadExecutable(unloadThese[i]); } _scheduledBundlesAreUnloading = false; CFAllocatorDeallocate(kCFAllocatorSystemDefault, unloadThese); } } pthread_mutex_unlock(&CFBundleGlobalDataLock); } #pragma mark - CF_PRIVATE _CFResourceData *__CFBundleGetResourceData(CFBundleRef bundle) { return &(bundle->_resourceData); } CFPlugInRef CFBundleGetPlugIn(CFBundleRef bundle) { return (bundle->_plugInData._isPlugIn) ? (CFPlugInRef)bundle : NULL; } CF_PRIVATE _CFPlugInData *__CFBundleGetPlugInData(CFBundleRef bundle) { return &(bundle->_plugInData); } CF_PRIVATE Boolean _CFBundleCouldBeBundle(CFURLRef url) { Boolean result = false; Boolean exists; SInt32 mode; if (_CFGetFileProperties(kCFAllocatorSystemDefault, url, &exists, &mode, NULL, NULL, NULL, NULL) == 0) result = (exists && (mode & S_IFMT) == S_IFDIR && (mode & 0444) != 0); return result; } #define LENGTH_OF(A) (sizeof(A) / sizeof(A[0])) //If 'permissive' is set, we will maintain the historical behavior of returning frameworks with names that don't match, and frameworks for executables in Resources/ static CFURLRef __CFBundleCopyFrameworkURLForExecutablePath(CFStringRef executablePath, Boolean permissive) { // MF:!!! Implement me. We need to be able to find the bundle from the exe, dealing with old vs. new as well as the Executables dir business on Windows. #if DEPLOYMENT_TARGET_WINDOWS UniChar executablesToFrameworksPathBuff[] = {'.', '.', '\\', 'F', 'r', 'a', 'm', 'e', 'w', 'o', 'r', 'k', 's'}; UniChar executablesToPrivateFrameworksPathBuff[] = {'.', '.', '\\', 'P', 'r', 'i', 'v', 'a', 't', 'e', 'F', 'r', 'a', 'm', 'e', 'w', 'o', 'r', 'k', 's'}; UniChar frameworksExtension[] = {'f', 'r', 'a', 'm', 'e', 'w', 'o', 'r', 'k'}; #endif UniChar pathBuff[CFMaxPathSize] = {0}; UniChar nameBuff[CFMaxPathSize] = {0}; CFIndex length, nameStart, nameLength, savedLength; CFMutableStringRef cheapStr = CFStringCreateMutableWithExternalCharactersNoCopy(kCFAllocatorSystemDefault, NULL, 0, 0, NULL); CFURLRef bundleURL = NULL; length = CFStringGetLength(executablePath); if (length > CFMaxPathSize) length = CFMaxPathSize; CFStringGetCharacters(executablePath, CFRangeMake(0, length), pathBuff); // Save the name in nameBuff length = _CFLengthAfterDeletingPathExtension(pathBuff, length); nameStart = _CFStartOfLastPathComponent(pathBuff, length); nameLength = length - nameStart; memmove(nameBuff, &(pathBuff[nameStart]), nameLength * sizeof(UniChar)); // Strip the name from pathBuff length = _CFLengthAfterDeletingLastPathComponent(pathBuff, length); savedLength = length; #if DEPLOYMENT_TARGET_WINDOWS // * (Windows-only) First check the "Executables" directory parallel to the "Frameworks" directory case. if (_CFAppendPathComponent(pathBuff, &length, CFMaxPathSize, executablesToFrameworksPathBuff, LENGTH_OF(executablesToFrameworksPathBuff)) && _CFAppendPathComponent(pathBuff, &length, CFMaxPathSize, nameBuff, nameLength) && _CFAppendPathExtension(pathBuff, &length, CFMaxPathSize, frameworksExtension, LENGTH_OF(frameworksExtension))) { CFStringSetExternalCharactersNoCopy(cheapStr, pathBuff, length, CFMaxPathSize); bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, cheapStr, PLATFORM_PATH_STYLE, true); if (!_CFBundleCouldBeBundle(bundleURL)) { CFRelease(bundleURL); bundleURL = NULL; } } // * (Windows-only) Next check the "Executables" directory parallel to the "PrivateFrameworks" directory case. if (!bundleURL) { length = savedLength; if (_CFAppendPathComponent(pathBuff, &length, CFMaxPathSize, executablesToPrivateFrameworksPathBuff, LENGTH_OF(executablesToPrivateFrameworksPathBuff)) && _CFAppendPathComponent(pathBuff, &length, CFMaxPathSize, nameBuff, nameLength) && _CFAppendPathExtension(pathBuff, &length, CFMaxPathSize, frameworksExtension, LENGTH_OF(frameworksExtension))) { CFStringSetExternalCharactersNoCopy(cheapStr, pathBuff, length, CFMaxPathSize); bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, cheapStr, PLATFORM_PATH_STYLE, true); if (!_CFBundleCouldBeBundle(bundleURL)) { CFRelease(bundleURL); bundleURL = NULL; } } } #endif // * Finally check the executable inside the framework case. if (!bundleURL) { length = savedLength; // To catch all the cases, we just peel off level looking for one ending in .framework or one called "Supporting Files". CFStringRef name = permissive ? CFSTR("") : CFStringCreateWithFileSystemRepresentation(kCFAllocatorSystemDefault, (const char *)nameBuff); while (length > 0) { CFIndex curStart = _CFStartOfLastPathComponent(pathBuff, length); if (curStart >= length) break; CFStringSetExternalCharactersNoCopy(cheapStr, &(pathBuff[curStart]), length - curStart, CFMaxPathSize - curStart); if (!permissive && CFEqual(cheapStr, _CFBundleResourcesDirectoryName)) break; if (CFEqual(cheapStr, _CFBundleSupportFilesDirectoryName1) || CFEqual(cheapStr, _CFBundleSupportFilesDirectoryName2)) { if (!permissive) { CFIndex fmwkStart = _CFStartOfLastPathComponent(pathBuff, length); CFStringSetExternalCharactersNoCopy(cheapStr, &(pathBuff[fmwkStart]), length - fmwkStart, CFMaxPathSize - fmwkStart); } if (permissive || CFStringHasPrefix(cheapStr, name)) { length = _CFLengthAfterDeletingLastPathComponent(pathBuff, length); CFStringSetExternalCharactersNoCopy(cheapStr, pathBuff, length, CFMaxPathSize); bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, cheapStr, PLATFORM_PATH_STYLE, true); if (!_CFBundleCouldBeBundle(bundleURL)) { CFRelease(bundleURL); bundleURL = NULL; } break; } } else if (CFStringHasSuffix(cheapStr, CFSTR(".framework")) && (permissive || CFStringHasPrefix(cheapStr, name))) { CFStringSetExternalCharactersNoCopy(cheapStr, pathBuff, length, CFMaxPathSize); bundleURL = CFURLCreateWithFileSystemPath(kCFAllocatorSystemDefault, cheapStr, PLATFORM_PATH_STYLE, true); if (!_CFBundleCouldBeBundle(bundleURL)) { CFRelease(bundleURL); bundleURL = NULL; } break; } length = _CFLengthAfterDeletingLastPathComponent(pathBuff, length); } if (!permissive) CFRelease(name); } CFStringSetExternalCharactersNoCopy(cheapStr, NULL, 0, 0); CFRelease(cheapStr); return bundleURL; } //SPI version; separated out to minimize linkage changes CFURLRef _CFBundleCopyFrameworkURLForExecutablePath(CFStringRef executablePath) { return __CFBundleCopyFrameworkURLForExecutablePath(executablePath, false); } static void _CFBundleEnsureBundleExistsForImagePath(CFStringRef imagePath) { // This finds the bundle for the given path. // If an image path corresponds to a bundle, we see if there is already a bundle instance. If there is and it is NOT in the _dynamicBundles array, it is added to the staticBundles. Do not add the main bundle to the list here. CFBundleRef bundle; CFURLRef curURL = __CFBundleCopyFrameworkURLForExecutablePath(imagePath, true); Boolean createdBundle = false; if (curURL) { bundle = _CFBundleCopyBundleForURL(curURL, true); if (!bundle) { // Ensure bundle exists by creating it if necessary // NB doFinalProcessing must be false here, see below bundle = _CFBundleCreate(kCFAllocatorSystemDefault, curURL, true, false, false); createdBundle = true; } if (bundle) { pthread_mutex_lock(&(bundle->_bundleLoadingLock)); if (!bundle->_isLoaded) { // make sure that these bundles listed as loaded, and mark them frameworks (we probably can't see anything else here, and we cannot unload them) #if defined(BINARY_SUPPORT_DLFCN) if (!bundle->_isLoaded) _CFBundleDlfcnCheckLoaded(bundle); #elif defined(BINARY_SUPPORT_DYLD) if (!bundle->_isLoaded) _CFBundleDYLDCheckLoaded(bundle); #endif /* BINARY_SUPPORT_DLFCN */ #if defined(BINARY_SUPPORT_DYLD) if (bundle->_binaryType == __CFBundleUnknownBinary) bundle->_binaryType = __CFBundleDYLDFrameworkBinary; if (bundle->_binaryType != __CFBundleCFMBinary && bundle->_binaryType != __CFBundleUnreadableBinary) bundle->_resourceData._executableLacksResourceFork = true; #endif /* BINARY_SUPPORT_DYLD */ #if LOG_BUNDLE_LOAD if (!bundle->_isLoaded) printf("ensure bundle %p set loaded fallback, handle %p image %p conn %p\n", bundle, bundle->_handleCookie, bundle->_imageCookie, bundle->_connectionCookie); #endif /* LOG_BUNDLE_LOAD */ bundle->_isLoaded = true; } pthread_mutex_unlock(&(bundle->_bundleLoadingLock)); if (createdBundle) { // Perform delayed final processing steps. // This must be done after _isLoaded has been set, for security reasons (3624341). if (_CFBundleNeedsInitPlugIn(bundle)) { pthread_mutex_unlock(&CFBundleGlobalDataLock); _CFBundleInitPlugIn(bundle); pthread_mutex_lock(&CFBundleGlobalDataLock); } } else { // Release the bundle if we did not create it here CFRelease(bundle); } } CFRelease(curURL); } } static void _CFBundleEnsureBundlesExistForImagePaths(CFArrayRef imagePaths) { // This finds the bundles for the given paths. // If an image path corresponds to a bundle, we see if there is already a bundle instance. If there is and it is NOT in the _dynamicBundles array, it is added to the staticBundles. Do not add the main bundle to the list here (even if it appears in imagePaths). CFIndex i, imagePathCount = CFArrayGetCount(imagePaths); for (i = 0; i < imagePathCount; i++) _CFBundleEnsureBundleExistsForImagePath((CFStringRef)CFArrayGetValueAtIndex(imagePaths, i)); } static void _CFBundleEnsureBundlesUpToDateWithHintAlreadyLocked(CFStringRef hint) { CFArrayRef imagePaths = NULL; // Tickle the main bundle into existence (void)_CFBundleGetMainBundleAlreadyLocked(); #if defined(BINARY_SUPPORT_DYLD) imagePaths = _CFBundleDYLDCopyLoadedImagePathsForHint(hint); #endif /* BINARY_SUPPORT_DYLD */ if (imagePaths) { _CFBundleEnsureBundlesExistForImagePaths(imagePaths); CFRelease(imagePaths); } } static void _CFBundleEnsureAllBundlesUpToDateAlreadyLocked(void) { // This method returns all the statically linked bundles. This includes the main bundle as well as any frameworks that the process was linked against at launch time. It does not include frameworks or opther bundles that were loaded dynamically. CFArrayRef imagePaths = NULL; // Tickle the main bundle into existence (void)_CFBundleGetMainBundleAlreadyLocked(); #if defined(BINARY_SUPPORT_DLL) // Dont know how to find static bundles for DLLs #endif /* BINARY_SUPPORT_DLL */ #if defined(BINARY_SUPPORT_DYLD) imagePaths = _CFBundleDYLDCopyLoadedImagePathsIfChanged(); #endif /* BINARY_SUPPORT_DYLD */ if (imagePaths) { _CFBundleEnsureBundlesExistForImagePaths(imagePaths); CFRelease(imagePaths); } } CFArrayRef CFBundleGetAllBundles(void) { // To answer this properly, we have to have created the static bundles! CFArrayRef bundles; pthread_mutex_lock(&CFBundleGlobalDataLock); _CFBundleEnsureAllBundlesUpToDateAlreadyLocked(); bundles = _allBundles; pthread_mutex_unlock(&CFBundleGlobalDataLock); return bundles; } CF_EXPORT CFArrayRef _CFBundleCopyAllBundles(void) { // To answer this properly, we have to have created the static bundles! pthread_mutex_lock(&CFBundleGlobalDataLock); _CFBundleEnsureAllBundlesUpToDateAlreadyLocked(); CFArrayRef bundles = CFArrayCreateCopy(kCFAllocatorSystemDefault, _allBundles); pthread_mutex_unlock(&CFBundleGlobalDataLock); return bundles; } CF_PRIVATE uint8_t _CFBundleLayoutVersion(CFBundleRef bundle) { return bundle->_version; } CF_EXPORT CFURLRef _CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle) { return CFBundleCopyPrivateFrameworksURL(bundle); } CF_EXPORT CFURLRef CFBundleCopyPrivateFrameworksURL(CFBundleRef bundle) { CFURLRef result = NULL; if (1 == bundle->_version) { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundlePrivateFrameworksURLFromBase1, bundle->_url); } else if (2 == bundle->_version) { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundlePrivateFrameworksURLFromBase2, bundle->_url); } else { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundlePrivateFrameworksURLFromBase0, bundle->_url); } return result; } CF_EXPORT CFURLRef _CFBundleCopySharedFrameworksURL(CFBundleRef bundle) { return CFBundleCopySharedFrameworksURL(bundle); } CF_EXPORT CFURLRef CFBundleCopySharedFrameworksURL(CFBundleRef bundle) { CFURLRef result = NULL; if (1 == bundle->_version) { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundleSharedFrameworksURLFromBase1, bundle->_url); } else if (2 == bundle->_version) { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundleSharedFrameworksURLFromBase2, bundle->_url); } else { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundleSharedFrameworksURLFromBase0, bundle->_url); } return result; } CF_EXPORT CFURLRef _CFBundleCopySharedSupportURL(CFBundleRef bundle) { return CFBundleCopySharedSupportURL(bundle); } CF_EXPORT CFURLRef CFBundleCopySharedSupportURL(CFBundleRef bundle) { CFURLRef result = NULL; if (1 == bundle->_version) { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundleSharedSupportURLFromBase1, bundle->_url); } else if (2 == bundle->_version) { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundleSharedSupportURLFromBase2, bundle->_url); } else { result = CFURLCreateWithString(CFGetAllocator(bundle), _CFBundleSharedSupportURLFromBase0, bundle->_url); } return result; } CF_PRIVATE CFURLRef _CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle) { return CFBundleCopyBuiltInPlugInsURL(bundle); } CF_EXPORT CFURLRef CFBundleCopyBuiltInPlugInsURL(CFBundleRef bundle) { CFURLRef result = NULL, alternateResult = NULL; CFAllocatorRef alloc = CFGetAllocator(bundle); if (1 == bundle->_version) { result = CFURLCreateWithString(alloc, _CFBundleBuiltInPlugInsURLFromBase1, bundle->_url); } else if (2 == bundle->_version) { result = CFURLCreateWithString(alloc, _CFBundleBuiltInPlugInsURLFromBase2, bundle->_url); } else { result = CFURLCreateWithString(alloc, _CFBundleBuiltInPlugInsURLFromBase0, bundle->_url); } if (!result || !_urlExists(result)) { if (1 == bundle->_version) { alternateResult = CFURLCreateWithString(alloc, _CFBundleAlternateBuiltInPlugInsURLFromBase1, bundle->_url); } else if (2 == bundle->_version) { alternateResult = CFURLCreateWithString(alloc, _CFBundleAlternateBuiltInPlugInsURLFromBase2, bundle->_url); } else { alternateResult = CFURLCreateWithString(alloc, _CFBundleAlternateBuiltInPlugInsURLFromBase0, bundle->_url); } if (alternateResult && _urlExists(alternateResult)) { if (result) CFRelease(result); result = alternateResult; } else { if (alternateResult) CFRelease(alternateResult); } } return result; }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/macosx/find-dsym/deep-bundle/main.c
#include <MyFramework/MyFramework.h> #include <unistd.h> #include <stdlib.h> int setup_is_complete = 0; int main() { system ("/bin/rm -rf MyFramework MyFramework.framework MyFramework.framework.dSYM"); setup_is_complete = 1; // At this point we want lldb to attach to the process. If lldb attaches // before we've removed the framework we're running against, it will be // easy for lldb to find the binary & dSYM without using target.exec-search-paths, // which is the point of this test. for (int loop_limiter = 0; loop_limiter < 100; loop_limiter++) sleep (1); return foo(); }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Symbol/ObjectContainer.h
<filename>SymbolExtractorAndRenamer/lldb/include/lldb/Symbol/ObjectContainer.h<gh_stars>100-1000 //===-- ObjectContainer.h ---------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ObjectContainer_h_ #define liblldb_ObjectContainer_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Core/DataExtractor.h" #include "lldb/Core/ModuleChild.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Host/Endian.h" #include "lldb/Host/FileSpec.h" #include "lldb/lldb-private.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class ObjectContainer ObjectContainer.h "lldb/Symbol/ObjectContainer.h" /// @brief A plug-in interface definition class for object containers. /// /// Object containers contain object files from one or more /// architectures, and also can contain one or more named objects. /// /// Typical object containers are static libraries (.a files) that /// contain multiple named object files, and universal files that contain /// multiple architectures. //---------------------------------------------------------------------- class ObjectContainer : public PluginInterface, public ModuleChild { public: //------------------------------------------------------------------ /// Construct with a parent module, offset, and header data. /// /// Object files belong to modules and a valid module must be /// supplied upon construction. The at an offset within a file for /// objects that contain more than one architecture or object. //------------------------------------------------------------------ ObjectContainer(const lldb::ModuleSP &module_sp, const FileSpec *file, lldb::offset_t file_offset, lldb::offset_t length, lldb::DataBufferSP &data_sp, lldb::offset_t data_offset) : ModuleChild(module_sp), m_file(), // This file can be different than the module's file spec m_offset(file_offset), m_length(length), m_data() { if (file) m_file = *file; if (data_sp) m_data.SetData(data_sp, data_offset, length); } //------------------------------------------------------------------ /// Destructor. /// /// The destructor is virtual since this class is designed to be /// inherited from by the plug-in instance. //------------------------------------------------------------------ ~ObjectContainer() override = default; //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the current contents of this object /// to the supplied stream \a s. The dumping should include the /// section list if it has been parsed, and the symbol table /// if it has been parsed. /// /// @param[in] s /// The stream to which to dump the object description. //------------------------------------------------------------------ virtual void Dump(Stream *s) const = 0; //------------------------------------------------------------------ /// Gets the architecture given an index. /// /// Copies the architecture specification for index \a idx. /// /// @param[in] idx /// The architecture index to extract. /// /// @param[out] arch /// A architecture object that will be filled in if \a idx is a /// architecture valid index. /// /// @return /// Returns \b true if \a idx is valid and \a arch has been /// filled in, \b false otherwise. /// /// @see ObjectContainer::GetNumArchitectures() const //------------------------------------------------------------------ virtual bool GetArchitectureAtIndex(uint32_t idx, ArchSpec &arch) const { return false; } //------------------------------------------------------------------ /// Returns the offset into a file at which this object resides. /// /// Some files contain many object files, and this function allows /// access to an object's offset within the file. /// /// @return /// The offset in bytes into the file. Defaults to zero for /// simple object files that a represented by an entire file. //------------------------------------------------------------------ virtual lldb::addr_t GetOffset() const { return m_offset; } virtual lldb::addr_t GetByteSize() const { return m_length; } //------------------------------------------------------------------ /// Get the number of objects within this object file (archives). /// /// @return /// Zero for object files that are not archives, or the number /// of objects contained in the archive. //------------------------------------------------------------------ virtual size_t GetNumObjects() const { return 0; } //------------------------------------------------------------------ /// Get the number of architectures in this object file. /// /// The default implementation returns 1 as for object files that /// contain a single architecture. ObjectContainer instances that /// contain more than one architecture should override this function /// and return an appropriate value. /// /// @return /// The number of architectures contained in this object file. //------------------------------------------------------------------ virtual size_t GetNumArchitectures() const { return 0; } //------------------------------------------------------------------ /// Attempts to parse the object header. /// /// This function is used as a test to see if a given plug-in /// instance can parse the header data already contained in /// ObjectContainer::m_data. If an object file parser does not /// recognize that magic bytes in a header, false should be returned /// and the next plug-in can attempt to parse an object file. /// /// @return /// Returns \b true if the header was parsed successfully, \b /// false otherwise. //------------------------------------------------------------------ virtual bool ParseHeader() = 0; //------------------------------------------------------------------ /// Selects an architecture in an object file. /// /// Object files that contain a single architecture should verify /// that the specified \a arch matches the architecture in in /// object file and return \b true or \b false accordingly. /// /// Object files that contain more than one architecture should /// attempt to select that architecture, and if successful, clear /// out any previous state from any previously selected architecture /// and prepare to return information for the new architecture. /// /// @return /// Returns a pointer to the object file of the requested \a /// arch and optional \a name. Returns nullptr of no such object /// file exists in the container. //------------------------------------------------------------------ virtual lldb::ObjectFileSP GetObjectFile(const FileSpec *file) = 0; virtual bool ObjectAtIndexIsContainer(uint32_t object_idx) { return false; } virtual ObjectFile *GetObjectFileAtIndex(uint32_t object_idx) { return nullptr; } virtual ObjectContainer *GetObjectContainerAtIndex(uint32_t object_idx) { return nullptr; } virtual const char *GetObjectNameAtIndex(uint32_t object_idx) const { return nullptr; } protected: //------------------------------------------------------------------ // Member variables. //------------------------------------------------------------------ FileSpec m_file; ///< The file that represents this container objects (which ///can be different from the module's file). lldb::addr_t m_offset; ///< The offset in bytes into the file, or the address in memory lldb::addr_t m_length; ///< The size in bytes if known (can be zero). DataExtractor m_data; ///< The data for this object file so things can be parsed lazily. private: DISALLOW_COPY_AND_ASSIGN(ObjectContainer); }; } // namespace lldb_private #endif // liblldb_ObjectContainer_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift-corelibs-foundation/CoreFoundation/URL.subproj/CFURLComponents.h
// This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2015 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See http://swift.org/LICENSE.txt for license information // See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // /* CFURLComponents.h Copyright (c) 2015, Apple Inc. All rights reserved. */ #ifndef __COREFOUNDATION_CFURLCOMPONENTS__ #define __COREFOUNDATION_CFURLCOMPONENTS__ // This file is for the use of NSURLComponents only. #include <CoreFoundation/CFBase.h> #include <CoreFoundation/CFURL.h> #include <CoreFoundation/CFString.h> #include <CoreFoundation/CFNumber.h> CF_IMPLICIT_BRIDGING_ENABLED CF_EXTERN_C_BEGIN CF_ASSUME_NONNULL_BEGIN #ifndef CF_SWIFT_EXPORT #if DEPLOYMENT_RUNTIME_SWIFT #define CF_SWIFT_EXPORT extern #else #define CF_SWIFT_EXPORT static __attribute__((used)) #endif #endif typedef struct __CFURLComponents *CFURLComponentsRef; CF_EXPORT CFTypeID _CFURLComponentsGetTypeID(void); CF_SWIFT_EXPORT void __CFURLComponentsDeallocate(CFURLComponentsRef); // URLComponents are always mutable. CF_EXPORT _Nullable CFURLComponentsRef _CFURLComponentsCreate(CFAllocatorRef alloc); CF_EXPORT _Nullable CFURLComponentsRef _CFURLComponentsCreateWithURL(CFAllocatorRef alloc, CFURLRef url, Boolean resolveAgainstBaseURL); CF_EXPORT _Nullable CFURLComponentsRef _CFURLComponentsCreateWithString(CFAllocatorRef alloc, CFStringRef string); CF_EXPORT _Nullable CFURLComponentsRef _CFURLComponentsCreateCopy(CFAllocatorRef alloc, CFURLComponentsRef components); CF_EXPORT _Nullable CFURLRef _CFURLComponentsCopyURL(CFURLComponentsRef components); CF_EXPORT _Nullable CFURLRef _CFURLComponentsCopyURLRelativeToURL(CFURLComponentsRef components, _Nullable CFURLRef relativeToURL); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyString(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyScheme(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyUser(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPassword(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyHost(CFURLComponentsRef components); CF_EXPORT _Nullable CFNumberRef _CFURLComponentsCopyPort(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPath(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyQuery(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyFragment(CFURLComponentsRef components); // These return false if the conversion fails CF_EXPORT Boolean _CFURLComponentsSetScheme(CFURLComponentsRef components, _Nullable CFStringRef scheme); CF_EXPORT Boolean _CFURLComponentsSetUser(CFURLComponentsRef components, _Nullable CFStringRef user); CF_EXPORT Boolean _CFURLComponentsSetPassword(CFURLComponentsRef components, _Nullable CFStringRef password); CF_EXPORT Boolean _CFURLComponentsSetHost(CFURLComponentsRef components, _Nullable CFStringRef host); CF_EXPORT Boolean _CFURLComponentsSetPort(CFURLComponentsRef components, _Nullable CFNumberRef port); CF_EXPORT Boolean _CFURLComponentsSetPath(CFURLComponentsRef components, _Nullable CFStringRef path); CF_EXPORT Boolean _CFURLComponentsSetQuery(CFURLComponentsRef components, _Nullable CFStringRef query); CF_EXPORT Boolean _CFURLComponentsSetFragment(CFURLComponentsRef components, _Nullable CFStringRef fragment); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPercentEncodedUser(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPercentEncodedPassword(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPercentEncodedHost(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPercentEncodedPath(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPercentEncodedQuery(CFURLComponentsRef components); CF_EXPORT _Nullable CFStringRef _CFURLComponentsCopyPercentEncodedFragment(CFURLComponentsRef components); // These return false if the conversion fails CF_EXPORT Boolean _CFURLComponentsSetPercentEncodedUser(CFURLComponentsRef components, _Nullable CFStringRef user); CF_EXPORT Boolean _CFURLComponentsSetPercentEncodedPassword(CFURLComponentsRef components, _Nullable CFStringRef password); CF_EXPORT Boolean _CFURLComponentsSetPercentEncodedHost(CFURLComponentsRef components, _Nullable CFStringRef host); CF_EXPORT Boolean _CFURLComponentsSetPercentEncodedPath(CFURLComponentsRef components, _Nullable CFStringRef path); CF_EXPORT Boolean _CFURLComponentsSetPercentEncodedQuery(CFURLComponentsRef components, _Nullable CFStringRef query); CF_EXPORT Boolean _CFURLComponentsSetPercentEncodedFragment(CFURLComponentsRef components, _Nullable CFStringRef fragment); CF_EXPORT CFRange _CFURLComponentsGetRangeOfScheme(CFURLComponentsRef components); CF_EXPORT CFRange _CFURLComponentsGetRangeOfUser(CFURLComponentsRef components); CF_EXPORT CFRange _CFURLComponentsGetRangeOfPassword(CFURLComponentsRef components); CF_EXPORT CFRange _CFURLComponentsGetRangeOfHost(CFURLComponentsRef components); CF_EXPORT CFRange _CFURLComponentsGetRangeOfPort(CFURLComponentsRef components); CF_EXPORT CFRange _CFURLComponentsGetRangeOfPath(CFURLComponentsRef components); CF_EXPORT CFRange _CFURLComponentsGetRangeOfQuery(CFURLComponentsRef components); CF_EXPORT CFRange _CFURLComponentsGetRangeOfFragment(CFURLComponentsRef components); CF_EXPORT CFStringRef _CFStringCreateByAddingPercentEncodingWithAllowedCharacters(CFAllocatorRef alloc, CFStringRef string, CFCharacterSetRef allowedCharacters); CF_EXPORT CFStringRef _Nullable _CFStringCreateByRemovingPercentEncoding(CFAllocatorRef alloc, CFStringRef string); // These return singletons CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLUserAllowedCharacterSet(void); CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLPasswordAllowedCharacterSet(void); CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLHostAllowedCharacterSet(void); CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLPathAllowedCharacterSet(void); CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLQueryAllowedCharacterSet(void); CF_EXPORT CFCharacterSetRef _CFURLComponentsGetURLFragmentAllowedCharacterSet(void); CF_EXPORT _Nullable CFArrayRef _CFURLComponentsCopyQueryItems(CFURLComponentsRef components); CF_EXPORT void _CFURLComponentsSetQueryItems(CFURLComponentsRef components, CFArrayRef names, CFArrayRef values); CF_ASSUME_NONNULL_END CF_EXTERN_C_END CF_IMPLICIT_BRIDGING_DISABLED #endif // __COREFOUNDATION_CFURLCOMPONENTS__
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.h
<reponame>Polidea/SiriusObfuscator //===-- GDBRemoteCommunicationServerCommon.h --------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_GDBRemoteCommunicationServerCommon_h_ #define liblldb_GDBRemoteCommunicationServerCommon_h_ // C Includes // C++ Includes #include <string> // Other libraries and framework includes // Project includes #include "lldb/Target/Process.h" #include "lldb/lldb-private-forward.h" #include "GDBRemoteCommunicationServer.h" #include "GDBRemoteCommunicationServerCommon.h" class StringExtractorGDBRemote; namespace lldb_private { namespace process_gdb_remote { class ProcessGDBRemote; class GDBRemoteCommunicationServerCommon : public GDBRemoteCommunicationServer { public: GDBRemoteCommunicationServerCommon(const char *comm_name, const char *listener_name); ~GDBRemoteCommunicationServerCommon() override; protected: ProcessLaunchInfo m_process_launch_info; Error m_process_launch_error; ProcessInstanceInfoList m_proc_infos; uint32_t m_proc_infos_index; bool m_thread_suffix_supported; bool m_list_threads_in_stop_reply; PacketResult Handle_A(StringExtractorGDBRemote &packet); PacketResult Handle_qHostInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qProcessInfoPID(StringExtractorGDBRemote &packet); PacketResult Handle_qfProcessInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qsProcessInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qUserName(StringExtractorGDBRemote &packet); PacketResult Handle_qGroupName(StringExtractorGDBRemote &packet); PacketResult Handle_qSpeedTest(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_Open(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_Close(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_pRead(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_pWrite(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_Size(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_Mode(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_Exists(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_symlink(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_unlink(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_Stat(StringExtractorGDBRemote &packet); PacketResult Handle_vFile_MD5(StringExtractorGDBRemote &packet); PacketResult Handle_qEcho(StringExtractorGDBRemote &packet); PacketResult Handle_qModuleInfo(StringExtractorGDBRemote &packet); PacketResult Handle_jModulesInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qPlatform_shell(StringExtractorGDBRemote &packet); PacketResult Handle_qPlatform_mkdir(StringExtractorGDBRemote &packet); PacketResult Handle_qPlatform_chmod(StringExtractorGDBRemote &packet); PacketResult Handle_qSupported(StringExtractorGDBRemote &packet); PacketResult Handle_QThreadSuffixSupported(StringExtractorGDBRemote &packet); PacketResult Handle_QListThreadsInStopReply(StringExtractorGDBRemote &packet); PacketResult Handle_QSetDetachOnError(StringExtractorGDBRemote &packet); PacketResult Handle_QStartNoAckMode(StringExtractorGDBRemote &packet); PacketResult Handle_QSetSTDIN(StringExtractorGDBRemote &packet); PacketResult Handle_QSetSTDOUT(StringExtractorGDBRemote &packet); PacketResult Handle_QSetSTDERR(StringExtractorGDBRemote &packet); PacketResult Handle_qLaunchSuccess(StringExtractorGDBRemote &packet); PacketResult Handle_QEnvironment(StringExtractorGDBRemote &packet); PacketResult Handle_QEnvironmentHexEncoded(StringExtractorGDBRemote &packet); PacketResult Handle_QLaunchArch(StringExtractorGDBRemote &packet); static void CreateProcessInfoResponse(const ProcessInstanceInfo &proc_info, StreamString &response); static void CreateProcessInfoResponse_DebugServerStyle( const ProcessInstanceInfo &proc_info, StreamString &response); template <typename T> void RegisterMemberFunctionHandler( StringExtractorGDBRemote::ServerPacketType packet_type, PacketResult (T::*handler)(StringExtractorGDBRemote &packet)) { RegisterPacketHandler(packet_type, [this, handler](StringExtractorGDBRemote packet, Error &error, bool &interrupt, bool &quit) { return (static_cast<T *>(this)->*handler)(packet); }); } //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar /// server in a situation where the startup code has been provided /// with all the information for a child process to be launched. /// /// @return /// An Error object indicating the success or failure of the /// launch. //------------------------------------------------------------------ virtual Error LaunchProcess() = 0; virtual FileSpec FindModuleFile(const std::string &module_path, const ArchSpec &arch); private: ModuleSpec GetModuleInfo(const std::string &module_path, const std::string &triple); }; } // namespace process_gdb_remote } // namespace lldb_private #endif // liblldb_GDBRemoteCommunicationServerCommon_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift/include/swift/Obfuscation/DataStructures.h
#ifndef DataStructures_h #define DataStructures_h #include "swift/Frontend/Frontend.h" #include "llvm/Support/YAMLTraits.h" #include "llvm/Support/Error.h" #include "swift/Basic/JSONSerialization.h" #include <vector> #include <string> namespace swift { namespace obfuscation { struct Project { std::string RootPath; std::string ProjectFilePath; }; struct Module { std::string Name; std::string TargetTriple; }; struct Sdk { std::string Name; std::string Path; }; struct ExplicitlyLinkedFrameworks { std::string Name; std::string Path; }; struct FilesJson { Project Project; Module Module; Sdk Sdk; std::vector<std::string> SourceFiles; std::vector<std::string> LayoutFiles; std::vector<std::string> ImplicitlyLinkedFrameworks; std::vector<ExplicitlyLinkedFrameworks> ExplicitlyLinkedFrameworks; std::vector<std::string> FrameworkSearchPaths; std::vector<std::string> HeaderSearchPaths; std::string BridgingHeader; std::string ConfigurationFile; }; enum class SymbolType: int { Type, NamedFunction, SingleParameter, ExternalParameter, InternalParameter, Variable, Operator }; struct Symbol { std::string Identifier; std::string Name; std::string Module; SymbolType Type; Symbol() = default; Symbol(const std::string &Identifier, const std::string &Name, const std::string &Module, SymbolType Type); bool operator< (const Symbol &Right) const; bool operator== (const Symbol &Right) const; }; using SingleSymbolOrError = llvm::Expected<Symbol>; struct SymbolsJson { std::vector<Symbol> Symbols; }; struct SymbolRenaming { std::string Identifier; std::string OriginalName; std::string ObfuscatedName; std::string Module; SymbolType Type; SymbolRenaming() = default; SymbolRenaming(const std::string &Identifier, const std::string &OriginalName, const std::string &ObfuscatedName, const std::string &Module, SymbolType Type); bool operator< (const SymbolRenaming &Right) const; bool operator== (const SymbolRenaming &Right) const; }; struct RenamesJson { std::vector<SymbolRenaming> Symbols; }; enum class ExclusionKind: int { UnknownKind, Type, Inheritance, Conformance }; struct TypeExclusion; struct InheritanceExclusion; struct ConformanceExclusion; struct Exclusion { std::string Module; ExclusionKind Kind; const TypeExclusion* getAsTypeExclusion() const; const InheritanceExclusion* getAsInheritanceExclusion() const; const ConformanceExclusion* getAsConformanceExclusion() const; }; struct TypeExclusion: public Exclusion { std::string Name; TypeExclusion() = default; TypeExclusion(const TypeExclusion&) = default; TypeExclusion(TypeExclusion&&) = default; }; struct InheritanceExclusion: public Exclusion { std::string Base; bool Transitive; InheritanceExclusion() = default; InheritanceExclusion(const InheritanceExclusion&) = default; InheritanceExclusion(InheritanceExclusion&&) = default; }; struct ConformanceExclusion: public Exclusion { std::string Protocol; bool Transitive; ConformanceExclusion() = default; ConformanceExclusion(const ConformanceExclusion&) = default; ConformanceExclusion(ConformanceExclusion&&) = default; }; struct ObfuscationConfiguration { std::vector<std::unique_ptr<Exclusion>> Exclude; ObfuscationConfiguration() = default; ObfuscationConfiguration(const ObfuscationConfiguration&) = delete; ObfuscationConfiguration(ObfuscationConfiguration&&) = default; ObfuscationConfiguration& operator=(const ObfuscationConfiguration &) = delete; ObfuscationConfiguration& operator=(ObfuscationConfiguration &&) = default; }; /// SymbolWithRange - struct for linking the symbol identified in the Swift /// source code with the range in which it was encountered. struct SymbolWithRange { Symbol Symbol; CharSourceRange Range; /// @brief Trivial memberwise-like constructor SymbolWithRange(const swift::obfuscation::Symbol &Symbol, const CharSourceRange &Range); /// @brief Comparison operator required for containing SymbolWithRange in /// sets. It's taking into consideration both symbol identifier and range. bool operator< (const SymbolWithRange &Right) const; bool operator== (const SymbolWithRange &Right) const; }; enum DeclarationProcessingContext { NoContext, FunctionCallAttribute }; struct DeclWithRange { Decl *Declaration; CharSourceRange Range; DeclarationProcessingContext Context; /// @brief Trivial memberwise-like constructor DeclWithRange(Decl* Declaration, const CharSourceRange &Range); bool operator< (const DeclWithRange &Right) const; bool operator== (const DeclWithRange &Right) const; }; struct DeclWithSymbolWithRange { Decl *Declaration; Symbol Symbol; CharSourceRange Range; /// @brief Trivial memberwise-like constructor DeclWithSymbolWithRange(Decl* Declaration, const SymbolWithRange &SymbolAndRange); DeclWithSymbolWithRange(const DeclWithRange &DeclAndRange, const struct Symbol &Symbol); DeclWithSymbolWithRange(Decl *Declaration, const struct Symbol &Symbol, CharSourceRange Range); bool operator< (const DeclWithSymbolWithRange &Right) const; bool operator== (const DeclWithSymbolWithRange &Right) const; }; template<typename T> using VectorOfExpected = std::vector<llvm::Expected<T>>; using DeclsWithRangesOrErrors = VectorOfExpected<DeclWithRange>; using DeclsWithSymbolsWithRangesOrErrors = VectorOfExpected<DeclWithSymbolWithRange>; template<typename T> VectorOfExpected<T> wrapInVector(T &); template<typename T> VectorOfExpected<T> wrapInVector(T &&); template<typename T> VectorOfExpected<T> wrapInVector(llvm::Error &&); struct IndexedDeclWithSymbolWithRange { int Index; Decl *Declaration; Symbol Symbol; CharSourceRange Range; /// @brief Trivial memberwise-like constructor IndexedDeclWithSymbolWithRange(const int Index, const DeclWithSymbolWithRange &DeclAndSymbolAndRange); /// @brief Comparison required for containing IndexedSymbolWithRange in sets. /// It's taking only symbol into consideration, not range nor index. struct SymbolCompare { bool operator() (const IndexedDeclWithSymbolWithRange& Left, const IndexedDeclWithSymbolWithRange& Right) const; }; /// @brief Comparison required for containing IndexedSymbolWithRange in sets. /// It's taking only symbol with range into consideration, not index. struct SymbolWithRangeCompare { bool operator() (const IndexedDeclWithSymbolWithRange& Left, const IndexedDeclWithSymbolWithRange& Right) const; }; }; using SingleSymbolOrError = llvm::Expected<Symbol>; using SymbolsOrError = llvm::Expected<std::vector<SymbolWithRange>>; using GlobalCollectedSymbols = std::set<IndexedDeclWithSymbolWithRange, IndexedDeclWithSymbolWithRange::SymbolWithRangeCompare>; } //namespace obfuscation } //namespace swift using namespace swift::obfuscation; // MARK: - Deserialization namespace llvm { namespace yaml { template <> struct MappingTraits<FilesJson> { static void mapping(IO &Io, FilesJson &Object); }; template <> struct MappingTraits<Project> { static void mapping(IO &Io, Project &Object); }; template <> struct MappingTraits<swift::obfuscation::Module> { static void mapping(IO &Io, swift::obfuscation::Module &Object); }; template <> struct MappingTraits<Sdk> { static void mapping(IO &Io, Sdk &Object); }; template <> struct MappingTraits<ExplicitlyLinkedFrameworks> { static void mapping(IO &Io, ExplicitlyLinkedFrameworks &Object); }; template <> struct MappingTraits<SymbolsJson> { static void mapping(IO &Io, SymbolsJson &Object); }; template <> struct ScalarEnumerationTraits<SymbolType> { static void enumeration(IO &Io, SymbolType &Enum); }; template <> struct MappingTraits<Symbol> { static void mapping(IO &Io, Symbol &Object); }; template <> struct MappingTraits<RenamesJson> { static void mapping(IO &Io, RenamesJson &Object); }; template <> struct MappingTraits<SymbolRenaming> { static void mapping(IO &Io, SymbolRenaming &Object); }; template <> struct MappingTraits<ObfuscationConfiguration> { static void mapping(IO &Io, ObfuscationConfiguration &Object); }; template <> struct ScalarEnumerationTraits<ExclusionKind> { static void enumeration(IO &Io, ExclusionKind &Enum); }; template <> struct MappingTraits<std::unique_ptr<Exclusion>> { static void mapping(IO &Io, std::unique_ptr<Exclusion> &Object); }; template <> struct MappingTraits<TypeExclusion> { static void mapping(IO &Io, TypeExclusion &Object); }; template <> struct MappingTraits<InheritanceExclusion> { static void mapping(IO &Io, InheritanceExclusion &Object); }; template <> struct MappingTraits<ConformanceExclusion> { static void mapping(IO &Io, ConformanceExclusion &Object); }; template <typename U> struct SequenceTraits<std::vector<U>> { static size_t size(IO &Io, std::vector<U> &Vec); static U &element(IO &Io, std::vector<U> &Vec, size_t Index); }; template<class T> Expected<T> deserialize(StringRef Json); } // namespace yaml } // namespace llvm // MARK: - Serialization namespace swift { namespace json { template <> struct ObjectTraits<SymbolsJson> { static void mapping(Output &Out, SymbolsJson &Object); }; template <> struct ScalarEnumerationTraits<SymbolType> { static void enumeration(Output &Out, SymbolType &Enum); }; template <> struct ObjectTraits<Symbol> { static void mapping(Output &Out, Symbol &Object); }; template <> struct ObjectTraits<RenamesJson> { static void mapping(Output &Out, RenamesJson &Object); }; template <> struct ObjectTraits<SymbolRenaming> { static void mapping(Output &Out, SymbolRenaming &Object); }; template<class T> std::string serialize(T &Object); } // namespace json } // namespace swift #endif /* DataStructures_h */
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Language/Swift/SwiftHashedContainer.h
//===-- SwiftHashedContainer.h ----------------------------------*- C++ -*-===// // // This source file is part of the Swift.org open source project // // Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors // Licensed under Apache License v2.0 with Runtime Library Exception // // See https://swift.org/LICENSE.txt for license information // See https://swift.org/CONTRIBUTORS.txt for the list of Swift project authors // //===----------------------------------------------------------------------===// #ifndef liblldb_SwiftHashedContainer_h_ #define liblldb_SwiftHashedContainer_h_ #include "lldb/lldb-forward.h" #include "lldb/Core/ConstString.h" #include "lldb/DataFormatters/FormatClasses.h" #include "lldb/DataFormatters/TypeSummary.h" #include "lldb/DataFormatters/TypeSynthetic.h" #include "lldb/Symbol/CompilerType.h" #include "lldb/Target/Target.h" #include <functional> namespace lldb_private { namespace formatters { namespace swift { // Some part of the buffer handling logic needs to be shared between summary and // synthetic children // If I was only making synthetic children, this would be best modelled as // different FrontEnds class SwiftHashedContainerBufferHandler { public: enum class Kind { eDictionary, eSet }; virtual Kind GetKind() = 0; virtual size_t GetCount() = 0; virtual lldb_private::CompilerType GetElementType() = 0; virtual lldb::ValueObjectSP GetElementAtIndex(size_t) = 0; typedef std::function<SwiftHashedContainerBufferHandler *( lldb::ValueObjectSP, CompilerType, CompilerType)> NativeCreatorFunction; typedef std::function<SwiftHashedContainerBufferHandler *( lldb::ValueObjectSP)> SyntheticCreatorFunction; static std::unique_ptr<SwiftHashedContainerBufferHandler> CreateBufferHandler(ValueObject &valobj, NativeCreatorFunction Native, SyntheticCreatorFunction Synthetic, ConstString mangled, ConstString demangled); virtual ~SwiftHashedContainerBufferHandler() {} protected: virtual bool IsValid() = 0; static std::unique_ptr<SwiftHashedContainerBufferHandler> CreateBufferHandlerForNativeStorageOwner(ValueObject &valobj, lldb::addr_t storage_ptr, bool fail_on_no_children, NativeCreatorFunction Native); }; class SwiftHashedContainerEmptyBufferHandler : public SwiftHashedContainerBufferHandler { public: virtual size_t GetCount() { return 0; } virtual lldb_private::CompilerType GetElementType() { return m_elem_type; } virtual lldb::ValueObjectSP GetElementAtIndex(size_t) { return lldb::ValueObjectSP(); } virtual ~SwiftHashedContainerEmptyBufferHandler() {} protected: SwiftHashedContainerEmptyBufferHandler(CompilerType elem_type) : m_elem_type(elem_type) {} friend class SwiftHashedContainerBufferHandler; virtual bool IsValid() { return true; } private: lldb_private::CompilerType m_elem_type; }; class SwiftHashedContainerNativeBufferHandler : public SwiftHashedContainerBufferHandler { public: virtual size_t GetCount(); virtual lldb_private::CompilerType GetElementType(); virtual lldb::ValueObjectSP GetElementAtIndex(size_t); virtual ~SwiftHashedContainerNativeBufferHandler() {} protected: typedef uint64_t Index; typedef uint64_t Cell; SwiftHashedContainerNativeBufferHandler(lldb::ValueObjectSP nativeStorage_sp, CompilerType key_type, CompilerType value_type); friend class SwiftHashedContainerBufferHandler; virtual bool IsValid(); bool ReadBitmaskAtIndex(Index); lldb::addr_t GetLocationOfKeyAtCell(Cell); lldb::addr_t GetLocationOfValueAtCell(Cell); bool GetDataForKeyAtCell(Cell, void *); bool GetDataForValueAtCell(Cell, void *); private: ValueObject *m_nativeStorage; Process *m_process; uint32_t m_ptr_size; uint64_t m_count; uint64_t m_capacity; lldb::addr_t m_bitmask_ptr; lldb::addr_t m_keys_ptr; lldb::addr_t m_values_ptr; CompilerType m_element_type; uint64_t m_key_stride; uint64_t m_value_stride; std::map<lldb::addr_t, uint64_t> m_bitmask_cache; }; class SwiftHashedContainerSyntheticFrontEndBufferHandler : public SwiftHashedContainerBufferHandler { public: virtual size_t GetCount(); virtual lldb_private::CompilerType GetElementType(); virtual lldb::ValueObjectSP GetElementAtIndex(size_t); virtual ~SwiftHashedContainerSyntheticFrontEndBufferHandler() {} protected: SwiftHashedContainerSyntheticFrontEndBufferHandler( lldb::ValueObjectSP valobj_sp); friend class SwiftHashedContainerBufferHandler; virtual bool IsValid(); private: lldb::ValueObjectSP m_valobj_sp; // reader beware: this entails you must only // pass self-rooted valueobjects to this // class std::unique_ptr<SyntheticChildrenFrontEnd> m_frontend; }; class HashedContainerSyntheticFrontEnd : public SyntheticChildrenFrontEnd { public: HashedContainerSyntheticFrontEnd(lldb::ValueObjectSP valobj_sp); virtual size_t CalculateNumChildren(); virtual lldb::ValueObjectSP GetChildAtIndex(size_t idx); virtual bool Update() = 0; virtual bool MightHaveChildren(); virtual size_t GetIndexOfChildWithName(const ConstString &name); virtual ~HashedContainerSyntheticFrontEnd() = default; protected: std::unique_ptr<SwiftHashedContainerBufferHandler> m_buffer; }; } } } #endif // liblldb_SwiftHashedContainer_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/Module.h
//===-- Module.h ------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Module_h_ #define liblldb_Module_h_ #include "lldb/Symbol/SymbolContextScope.h" // Project includes #include "lldb/Core/ArchSpec.h" #include "lldb/Core/UUID.h" #include "lldb/Host/FileSpec.h" #include "lldb/Symbol/ClangASTContext.h" #include "lldb/Symbol/SwiftASTContext.h" #include "lldb/Symbol/SymbolContextScope.h" #include "lldb/Symbol/TypeSystem.h" #include "lldb/Target/PathMappingList.h" #include "lldb/lldb-forward.h" // Other libraries and framework includes #include "llvm/ADT/DenseSet.h" #include "llvm/ADT/StringRef.h" #include "llvm/Support/Chrono.h" // C Includes // C++ Includes #include <atomic> #include <mutex> #include <string> #include <vector> namespace lldb_private { //---------------------------------------------------------------------- /// @class Module Module.h "lldb/Core/Module.h" /// @brief A class that describes an executable image and its associated /// object and symbol files. /// /// The module is designed to be able to select a single slice of an /// executable image as it would appear on disk and during program /// execution. /// /// Modules control when and if information is parsed according to which /// accessors are called. For example the object file (ObjectFile) /// representation will only be parsed if the object file is requested /// using the Module::GetObjectFile() is called. The debug symbols /// will only be parsed if the symbol vendor (SymbolVendor) is /// requested using the Module::GetSymbolVendor() is called. /// /// The module will parse more detailed information as more queries are /// made. //---------------------------------------------------------------------- class Module : public std::enable_shared_from_this<Module>, public SymbolContextScope { public: // Static functions that can track the lifetime of module objects. // This is handy because we might have Module objects that are in // shared pointers that aren't in the global module list (from // ModuleList). If this is the case we need to know about it. // The modules in the global list maintained by these functions // can be viewed using the "target modules list" command using the // "--global" (-g for short). static size_t GetNumberAllocatedModules(); static Module *GetAllocatedModuleAtIndex(size_t idx); static std::recursive_mutex &GetAllocationModuleCollectionMutex(); //------------------------------------------------------------------ /// Construct with file specification and architecture. /// /// Clients that wish to share modules with other targets should /// use ModuleList::GetSharedModule(). /// /// @param[in] file_spec /// The file specification for the on disk representation of /// this executable image. /// /// @param[in] arch /// The architecture to set as the current architecture in /// this module. /// /// @param[in] object_name /// The name of an object in a module used to extract a module /// within a module (.a files and modules that contain multiple /// architectures). /// /// @param[in] object_offset /// The offset within an existing module used to extract a /// module within a module (.a files and modules that contain /// multiple architectures). //------------------------------------------------------------------ Module( const FileSpec &file_spec, const ArchSpec &arch, const ConstString *object_name = nullptr, lldb::offset_t object_offset = 0, const llvm::sys::TimePoint<> &object_mod_time = llvm::sys::TimePoint<>()); Module(const ModuleSpec &module_spec); static lldb::ModuleSP CreateJITModule(const lldb::ObjectFileJITDelegateSP &delegate_sp); //------------------------------------------------------------------ /// Destructor. //------------------------------------------------------------------ ~Module() override; bool MatchesModuleSpec(const ModuleSpec &module_ref); //------------------------------------------------------------------ /// Set the load address for all sections in a module to be the /// file address plus \a slide. /// /// Many times a module will be loaded in a target with a constant /// offset applied to all top level sections. This function can /// set the load address for all top level sections to be the /// section file address + offset. /// /// @param[in] target /// The target in which to apply the section load addresses. /// /// @param[in] value /// if \a value_is_offset is true, then value is the offset to /// apply to all file addresses for all top level sections in /// the object file as each section load address is being set. /// If \a value_is_offset is false, then "value" is the new /// absolute base address for the image. /// /// @param[in] value_is_offset /// If \b true, then \a value is an offset to apply to each /// file address of each top level section. /// If \b false, then \a value is the image base address that /// will be used to rigidly slide all loadable sections. /// /// @param[out] changed /// If any section load addresses were changed in \a target, /// then \a changed will be set to \b true. Else \a changed /// will be set to false. This allows this function to be /// called multiple times on the same module for the same /// target. If the module hasn't moved, then \a changed will /// be false and no module updated notification will need to /// be sent out. /// /// @return /// /b True if any sections were successfully loaded in \a target, /// /b false otherwise. //------------------------------------------------------------------ bool SetLoadAddress(Target &target, lldb::addr_t value, bool value_is_offset, bool &changed); //------------------------------------------------------------------ /// @copydoc SymbolContextScope::CalculateSymbolContext(SymbolContext*) /// /// @see SymbolContextScope //------------------------------------------------------------------ void CalculateSymbolContext(SymbolContext *sc) override; lldb::ModuleSP CalculateSymbolContextModule() override; void GetDescription(Stream *s, lldb::DescriptionLevel level = lldb::eDescriptionLevelFull); //------------------------------------------------------------------ /// Get the module path and object name. /// /// Modules can refer to object files. In this case the specification /// is simple and would return the path to the file: /// /// "/usr/lib/foo.dylib" /// /// Modules can be .o files inside of a BSD archive (.a file). In /// this case, the object specification will look like: /// /// "/usr/lib/foo.a(bar.o)" /// /// There are many places where logging wants to log this fully /// qualified specification, so we centralize this functionality /// here. /// /// @return /// The object path + object name if there is one. //------------------------------------------------------------------ std::string GetSpecificationDescription() const; //------------------------------------------------------------------ /// Dump a description of this object to a Stream. /// /// Dump a description of the contents of this object to the /// supplied stream \a s. The dumped content will be only what has /// been loaded or parsed up to this point at which this function /// is called, so this is a good way to see what has been parsed /// in a module. /// /// @param[in] s /// The stream to which to dump the object description. //------------------------------------------------------------------ void Dump(Stream *s); //------------------------------------------------------------------ /// @copydoc SymbolContextScope::DumpSymbolContext(Stream*) /// /// @see SymbolContextScope //------------------------------------------------------------------ void DumpSymbolContext(Stream *s) override; //------------------------------------------------------------------ /// Find a symbol in the object file's symbol table. /// /// @param[in] name /// The name of the symbol that we are looking for. /// /// @param[in] symbol_type /// If set to eSymbolTypeAny, find a symbol of any type that /// has a name that matches \a name. If set to any other valid /// SymbolType enumeration value, then search only for /// symbols that match \a symbol_type. /// /// @return /// Returns a valid symbol pointer if a symbol was found, /// nullptr otherwise. //------------------------------------------------------------------ const Symbol *FindFirstSymbolWithNameAndType( const ConstString &name, lldb::SymbolType symbol_type = lldb::eSymbolTypeAny); size_t FindSymbolsWithNameAndType(const ConstString &name, lldb::SymbolType symbol_type, SymbolContextList &sc_list); size_t FindSymbolsMatchingRegExAndType(const RegularExpression &regex, lldb::SymbolType symbol_type, SymbolContextList &sc_list); //------------------------------------------------------------------ /// Find a function symbols in the object file's symbol table. /// /// @param[in] name /// The name of the symbol that we are looking for. /// /// @param[in] name_type_mask /// A mask that has one or more bitwise OR'ed values from the /// lldb::FunctionNameType enumeration type that indicate what /// kind of names we are looking for. /// /// @param[out] sc_list /// A list to append any matching symbol contexts to. /// /// @return /// The number of symbol contexts that were added to \a sc_list //------------------------------------------------------------------ size_t FindFunctionSymbols(const ConstString &name, uint32_t name_type_mask, SymbolContextList &sc_list); //------------------------------------------------------------------ /// Find compile units by partial or full path. /// /// Finds all compile units that match \a path in all of the modules /// and returns the results in \a sc_list. /// /// @param[in] path /// The name of the function we are looking for. /// /// @param[in] append /// If \b true, then append any compile units that were found /// to \a sc_list. If \b false, then the \a sc_list is cleared /// and the contents of \a sc_list are replaced. /// /// @param[out] sc_list /// A symbol context list that gets filled in with all of the /// matches. /// /// @return /// The number of matches added to \a sc_list. //------------------------------------------------------------------ size_t FindCompileUnits(const FileSpec &path, bool append, SymbolContextList &sc_list); //------------------------------------------------------------------ /// Find functions by name. /// /// If the function is an inlined function, it will have a block, /// representing the inlined function, and the function will be the /// containing function. If it is not inlined, then the block will /// be NULL. /// /// @param[in] name /// The name of the compile unit we are looking for. /// /// @param[in] namespace_decl /// If valid, a namespace to search in. /// /// @param[in] name_type_mask /// A bit mask of bits that indicate what kind of names should /// be used when doing the lookup. Bits include fully qualified /// names, base names, C++ methods, or ObjC selectors. /// See FunctionNameType for more details. /// /// @param[in] append /// If \b true, any matches will be appended to \a sc_list, else /// matches replace the contents of \a sc_list. /// /// @param[out] sc_list /// A symbol context list that gets filled in with all of the /// matches. /// /// @return /// The number of matches added to \a sc_list. //------------------------------------------------------------------ size_t FindFunctions(const ConstString &name, const CompilerDeclContext *parent_decl_ctx, uint32_t name_type_mask, bool symbols_ok, bool inlines_ok, bool append, SymbolContextList &sc_list); //------------------------------------------------------------------ /// Find functions by name. /// /// If the function is an inlined function, it will have a block, /// representing the inlined function, and the function will be the /// containing function. If it is not inlined, then the block will /// be NULL. /// /// @param[in] regex /// A regular expression to use when matching the name. /// /// @param[in] append /// If \b true, any matches will be appended to \a sc_list, else /// matches replace the contents of \a sc_list. /// /// @param[out] sc_list /// A symbol context list that gets filled in with all of the /// matches. /// /// @return /// The number of matches added to \a sc_list. //------------------------------------------------------------------ size_t FindFunctions(const RegularExpression &regex, bool symbols_ok, bool inlines_ok, bool append, SymbolContextList &sc_list); //------------------------------------------------------------------ /// Find addresses by file/line /// /// @param[in] target_sp /// The target the addresses are desired for. /// /// @param[in] file /// Source file to locate. /// /// @param[in] line /// Source line to locate. /// /// @param[in] function /// Optional filter function. Addresses within this function will be /// added to the 'local' list. All others will be added to the 'extern' /// list. /// /// @param[out] output_local /// All matching addresses within 'function' /// /// @param[out] output_extern /// All matching addresses not within 'function' void FindAddressesForLine(const lldb::TargetSP target_sp, const FileSpec &file, uint32_t line, Function *function, std::vector<Address> &output_local, std::vector<Address> &output_extern); //------------------------------------------------------------------ /// Find global and static variables by name. /// /// @param[in] name /// The name of the global or static variable we are looking /// for. /// /// @param[in] parent_decl_ctx /// If valid, a decl context that results must exist within /// /// @param[in] append /// If \b true, any matches will be appended to \a /// variable_list, else matches replace the contents of /// \a variable_list. /// /// @param[in] max_matches /// Allow the number of matches to be limited to \a /// max_matches. Specify UINT32_MAX to get all possible matches. /// /// @param[in] variable_list /// A list of variables that gets the matches appended to (if /// \a append it \b true), or replace (if \a append is \b false). /// /// @return /// The number of matches added to \a variable_list. //------------------------------------------------------------------ size_t FindGlobalVariables(const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, size_t max_matches, VariableList &variable_list); //------------------------------------------------------------------ /// Find global and static variables by regular expression. /// /// @param[in] regex /// A regular expression to use when matching the name. /// /// @param[in] append /// If \b true, any matches will be appended to \a /// variable_list, else matches replace the contents of /// \a variable_list. /// /// @param[in] max_matches /// Allow the number of matches to be limited to \a /// max_matches. Specify UINT32_MAX to get all possible matches. /// /// @param[in] variable_list /// A list of variables that gets the matches appended to (if /// \a append it \b true), or replace (if \a append is \b false). /// /// @return /// The number of matches added to \a variable_list. //------------------------------------------------------------------ size_t FindGlobalVariables(const RegularExpression &regex, bool append, size_t max_matches, VariableList &variable_list); //------------------------------------------------------------------ /// Find types by name. /// /// Type lookups in modules go through the SymbolVendor (which will /// use one or more SymbolFile subclasses). The SymbolFile needs to /// be able to lookup types by basename and not the fully qualified /// typename. This allows the type accelerator tables to stay small, /// even with heavily templatized C++. The type search will then /// narrow down the search results. If "exact_match" is true, then /// the type search will only match exact type name matches. If /// "exact_match" is false, the type will match as long as the base /// typename matches and as long as any immediate containing /// namespaces/class scopes that are specified match. So to search /// for a type "d" in "b::c", the name "b::c::d" can be specified /// and it will match any class/namespace "b" which contains a /// class/namespace "c" which contains type "d". We do this to /// allow users to not always have to specify complete scoping on /// all expressions, but it also allows for exact matching when /// required. /// /// @param[in] sc /// A symbol context that scopes where to extract a type list /// from. /// /// @param[in] type_name /// The name of the type we are looking for that is a fully /// or partially qualified type name. /// /// @param[in] exact_match /// If \b true, \a type_name is fully qualified and must match /// exactly. If \b false, \a type_name is a partially qualified /// name where the leading namespaces or classes can be /// omitted to make finding types that a user may type /// easier. /// /// @param[out] type_list /// A type list gets populated with any matches. /// /// @return /// The number of matches added to \a type_list. //------------------------------------------------------------------ size_t FindTypes(const SymbolContext &sc, const ConstString &type_name, bool exact_match, size_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeList &types); lldb::TypeSP FindFirstType(const SymbolContext &sc, const ConstString &type_name, bool exact_match); //------------------------------------------------------------------ /// Find types by name that are in a namespace. This function is /// used by the expression parser when searches need to happen in /// an exact namespace scope. /// /// @param[in] sc /// A symbol context that scopes where to extract a type list /// from. /// /// @param[in] type_name /// The name of a type within a namespace that should not include /// any qualifying namespaces (just a type basename). /// /// @param[in] namespace_decl /// The namespace declaration that this type must exist in. /// /// @param[out] type_list /// A type list gets populated with any matches. /// /// @return /// The number of matches added to \a type_list. //------------------------------------------------------------------ size_t FindTypesInNamespace(const SymbolContext &sc, const ConstString &type_name, const CompilerDeclContext *parent_decl_ctx, size_t max_matches, TypeList &type_list); //------------------------------------------------------------------ /// Get const accessor for the module architecture. /// /// @return /// A const reference to the architecture object. //------------------------------------------------------------------ const ArchSpec &GetArchitecture() const; //------------------------------------------------------------------ /// Get const accessor for the module file specification. /// /// This function returns the file for the module on the host system /// that is running LLDB. This can differ from the path on the /// platform since we might be doing remote debugging. /// /// @return /// A const reference to the file specification object. //------------------------------------------------------------------ const FileSpec &GetFileSpec() const { return m_file; } //------------------------------------------------------------------ /// Get accessor for the module platform file specification. /// /// Platform file refers to the path of the module as it is known on /// the remote system on which it is being debugged. For local /// debugging this is always the same as Module::GetFileSpec(). But /// remote debugging might mention a file "/usr/lib/liba.dylib" /// which might be locally downloaded and cached. In this case the /// platform file could be something like: /// "/tmp/lldb/platform-cache/remote.host.computer/usr/lib/liba.dylib" /// The file could also be cached in a local developer kit directory. /// /// @return /// A const reference to the file specification object. //------------------------------------------------------------------ const FileSpec &GetPlatformFileSpec() const { if (m_platform_file) return m_platform_file; return m_file; } void SetPlatformFileSpec(const FileSpec &file) { m_platform_file = file; } const FileSpec &GetRemoteInstallFileSpec() const { return m_remote_install_file; } void SetRemoteInstallFileSpec(const FileSpec &file) { m_remote_install_file = file; } const FileSpec &GetSymbolFileFileSpec() const { return m_symfile_spec; } void SetSymbolFileFileSpec(const FileSpec &file); const llvm::sys::TimePoint<> &GetModificationTime() const { return m_mod_time; } const llvm::sys::TimePoint<> &GetObjectModificationTime() const { return m_object_mod_time; } void SetObjectModificationTime(const llvm::sys::TimePoint<> &mod_time) { m_mod_time = mod_time; } //------------------------------------------------------------------ /// Tells whether this module is capable of being the main executable /// for a process. /// /// @return /// \b true if it is, \b false otherwise. //------------------------------------------------------------------ bool IsExecutable(); //------------------------------------------------------------------ /// Tells whether this module has been loaded in the target passed in. /// This call doesn't distinguish between whether the module is loaded /// by the dynamic loader, or by a "target module add" type call. /// /// @param[in] target /// The target to check whether this is loaded in. /// /// @return /// \b true if it is, \b false otherwise. //------------------------------------------------------------------ bool IsLoadedInTarget(Target *target); bool LoadScriptingResourceInTarget(Target *target, Error &error, Stream *feedback_stream = nullptr); //------------------------------------------------------------------ /// Get the number of compile units for this module. /// /// @return /// The number of compile units that the symbol vendor plug-in /// finds. //------------------------------------------------------------------ size_t GetNumCompileUnits(); lldb::CompUnitSP GetCompileUnitAtIndex(size_t idx); const ConstString &GetObjectName() const; uint64_t GetObjectOffset() const { return m_object_offset; } //------------------------------------------------------------------ /// Get the object file representation for the current architecture. /// /// If the object file has not been located or parsed yet, this /// function will find the best ObjectFile plug-in that can parse /// Module::m_file. /// /// @return /// If Module::m_file does not exist, or no plug-in was found /// that can parse the file, or the object file doesn't contain /// the current architecture in Module::m_arch, nullptr will be /// returned, else a valid object file interface will be /// returned. The returned pointer is owned by this object and /// remains valid as long as the object is around. //------------------------------------------------------------------ virtual ObjectFile *GetObjectFile(); //------------------------------------------------------------------ /// Get the unified section list for the module. This is the section /// list created by the module's object file and any debug info and /// symbol files created by the symbol vendor. /// /// If the symbol vendor has not been loaded yet, this function /// will return the section list for the object file. /// /// @return /// Unified module section list. //------------------------------------------------------------------ virtual SectionList *GetSectionList(); //------------------------------------------------------------------ /// Notify the module that the file addresses for the Sections have /// been updated. /// /// If the Section file addresses for a module are updated, this /// method should be called. Any parts of the module, object file, /// or symbol file that has cached those file addresses must invalidate /// or update its cache. //------------------------------------------------------------------ virtual void SectionFileAddressesChanged(); uint32_t GetVersion(uint32_t *versions, uint32_t num_versions); //------------------------------------------------------------------ /// Load an object file from memory. /// /// If available, the size of the object file in memory may be /// passed to avoid additional round trips to process memory. /// If the size is not provided, a default value is used. This /// value should be large enough to enable the ObjectFile plugins /// to read the header of the object file without going back to the /// process. /// /// @return /// The object file loaded from memory or nullptr, if the operation /// failed (see the `error` for more information in that case). //------------------------------------------------------------------ ObjectFile *GetMemoryObjectFile(const lldb::ProcessSP &process_sp, lldb::addr_t header_addr, Error &error, size_t size_to_read = 512); //------------------------------------------------------------------ /// Get the symbol vendor interface for the current architecture. /// /// If the symbol vendor file has not been located yet, this /// function will find the best SymbolVendor plug-in that can /// use the current object file. /// /// @return /// If this module does not have a valid object file, or no /// plug-in can be found that can use the object file, nullptr will /// be returned, else a valid symbol vendor plug-in interface /// will be returned. The returned pointer is owned by this /// object and remains valid as long as the object is around. //------------------------------------------------------------------ virtual SymbolVendor * GetSymbolVendor(bool can_create = true, lldb_private::Stream *feedback_strm = nullptr); //------------------------------------------------------------------ /// Get accessor the type list for this module. /// /// @return /// A valid type list pointer, or nullptr if there is no valid /// symbol vendor for this module. //------------------------------------------------------------------ TypeList *GetTypeList(); //------------------------------------------------------------------ /// Get a pointer to the UUID value contained in this object. /// /// If the executable image file doesn't not have a UUID value built /// into the file format, an MD5 checksum of the entire file, or /// slice of the file for the current architecture should be used. /// /// @return /// A const pointer to the internal copy of the UUID value in /// this module if this module has a valid UUID value, NULL /// otherwise. //------------------------------------------------------------------ const lldb_private::UUID &GetUUID(); //------------------------------------------------------------------ /// A debugging function that will cause everything in a module to /// be parsed. /// /// All compile units will be parsed, along with all globals and /// static variables and all functions for those compile units. /// All types, scopes, local variables, static variables, global /// variables, and line tables will be parsed. This can be used /// prior to dumping a module to see a complete list of the /// resulting debug information that gets parsed, or as a debug /// function to ensure that the module can consume all of the /// debug data the symbol vendor provides. //------------------------------------------------------------------ void ParseAllDebugSymbols(); bool ResolveFileAddress(lldb::addr_t vm_addr, Address &so_addr); //------------------------------------------------------------------ /// Resolve the symbol context for the given address. /// /// Tries to resolve the matching symbol context based on a lookup /// from the current symbol vendor. If the lazy lookup fails, /// an attempt is made to parse the eh_frame section to handle /// stripped symbols. If this fails, an attempt is made to resolve /// the symbol to the previous address to handle the case of a /// function with a tail call. /// /// Use properties of the modified SymbolContext to inspect any /// resolved target, module, compilation unit, symbol, function, /// function block or line entry. Use the return value to determine /// which of these properties have been modified. /// /// @param[in] so_addr /// A load address to resolve. /// /// @param[in] resolve_scope /// The scope that should be resolved (see SymbolContext::Scope). /// A combination of flags from the enumeration SymbolContextItem /// requesting a resolution depth. Note that the flags that are /// actually resolved may be a superset of the requested flags. /// For instance, eSymbolContextSymbol requires resolution of /// eSymbolContextModule, and eSymbolContextFunction requires /// eSymbolContextSymbol. /// /// @param[out] sc /// The SymbolContext that is modified based on symbol resolution. /// /// @param[in] resolve_tail_call_address /// Determines if so_addr should resolve to a symbol in the case /// of a function whose last instruction is a call. In this case, /// the PC can be one past the address range of the function. /// /// @return /// The scope that has been resolved (see SymbolContext::Scope). /// /// @see SymbolContext::Scope //------------------------------------------------------------------ uint32_t ResolveSymbolContextForAddress(const Address &so_addr, uint32_t resolve_scope, SymbolContext &sc, bool resolve_tail_call_address = false); //------------------------------------------------------------------ /// Resolve items in the symbol context for a given file and line. /// /// Tries to resolve \a file_path and \a line to a list of matching /// symbol contexts. /// /// The line table entries contains addresses that can be used to /// further resolve the values in each match: the function, block, /// symbol. Care should be taken to minimize the amount of /// information that is requested to only what is needed -- /// typically the module, compile unit, line table and line table /// entry are sufficient. /// /// @param[in] file_path /// A path to a source file to match. If \a file_path does not /// specify a directory, then this query will match all files /// whose base filename matches. If \a file_path does specify /// a directory, the fullpath to the file must match. /// /// @param[in] line /// The source line to match, or zero if just the compile unit /// should be resolved. /// /// @param[in] check_inlines /// Check for inline file and line number matches. This option /// should be used sparingly as it will cause all line tables /// for every compile unit to be parsed and searched for /// matching inline file entries. /// /// @param[in] resolve_scope /// The scope that should be resolved (see /// SymbolContext::Scope). /// /// @param[out] sc_list /// A symbol context list that gets matching symbols contexts /// appended to. /// /// @return /// The number of matches that were added to \a sc_list. /// /// @see SymbolContext::Scope //------------------------------------------------------------------ uint32_t ResolveSymbolContextForFilePath(const char *file_path, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList &sc_list); //------------------------------------------------------------------ /// Resolve items in the symbol context for a given file and line. /// /// Tries to resolve \a file_spec and \a line to a list of matching /// symbol contexts. /// /// The line table entries contains addresses that can be used to /// further resolve the values in each match: the function, block, /// symbol. Care should be taken to minimize the amount of /// information that is requested to only what is needed -- /// typically the module, compile unit, line table and line table /// entry are sufficient. /// /// @param[in] file_spec /// A file spec to a source file to match. If \a file_path does /// not specify a directory, then this query will match all /// files whose base filename matches. If \a file_path does /// specify a directory, the fullpath to the file must match. /// /// @param[in] line /// The source line to match, or zero if just the compile unit /// should be resolved. /// /// @param[in] check_inlines /// Check for inline file and line number matches. This option /// should be used sparingly as it will cause all line tables /// for every compile unit to be parsed and searched for /// matching inline file entries. /// /// @param[in] resolve_scope /// The scope that should be resolved (see /// SymbolContext::Scope). /// /// @param[out] sc_list /// A symbol context list that gets filled in with all of the /// matches. /// /// @return /// A integer that contains SymbolContext::Scope bits set for /// each item that was successfully resolved. /// /// @see SymbolContext::Scope //------------------------------------------------------------------ uint32_t ResolveSymbolContextsForFileSpec(const FileSpec &file_spec, uint32_t line, bool check_inlines, uint32_t resolve_scope, SymbolContextList &sc_list); void SetFileSpecAndObjectName(const FileSpec &file, const ConstString &object_name); bool GetIsDynamicLinkEditor(); // This function must be called immediately after construction of the Module // in the cases where the AST is to be shared. void SetTypeSystemForLanguage(lldb::LanguageType language, const lldb::TypeSystemSP &type_system_sp); #ifdef __clang_analyzer__ // See GetScratchTypeSystemForLanguage() in Target.h for what this block does TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language) __attribute__((always_inline)) { TypeSystem *ret = GetTypeSystemForLanguageImpl(language); return ret ? ret : nullptr; } TypeSystem *GetTypeSystemForLanguageImpl(lldb::LanguageType language); #else TypeSystem *GetTypeSystemForLanguage(lldb::LanguageType language); #endif // Special error functions that can do printf style formatting that will // prepend the message with // something appropriate for this module (like the architecture, path and // object name (if any)). // This centralizes code so that everyone doesn't need to format their error // and log messages on // their own and keeps the output a bit more consistent. void LogMessage(Log *log, const char *format, ...) __attribute__((format(printf, 3, 4))); void LogMessageVerboseBacktrace(Log *log, const char *format, ...) __attribute__((format(printf, 3, 4))); void ReportWarning(const char *format, ...) __attribute__((format(printf, 2, 3))); void ReportError(const char *format, ...) __attribute__((format(printf, 2, 3))); // Only report an error once when the module is first detected to be modified // so we don't spam the console with many messages. void ReportErrorIfModifyDetected(const char *format, ...) __attribute__((format(printf, 2, 3))); //------------------------------------------------------------------ // Return true if the file backing this module has changed since the // module was originally created since we saved the initial file // modification time when the module first gets created. //------------------------------------------------------------------ bool FileHasChanged() const; //------------------------------------------------------------------ // SymbolVendor, SymbolFile and ObjectFile member objects should // lock the module mutex to avoid deadlocks. //------------------------------------------------------------------ std::recursive_mutex &GetMutex() const { return m_mutex; } PathMappingList &GetSourceMappingList() { return m_source_mappings; } const PathMappingList &GetSourceMappingList() const { return m_source_mappings; } //------------------------------------------------------------------ /// Finds a source file given a file spec using the module source /// path remappings (if any). /// /// Tries to resolve \a orig_spec by checking the module source path /// remappings. It makes sure the file exists, so this call can be /// expensive if the remappings are on a network file system, so /// use this function sparingly (not in a tight debug info parsing /// loop). /// /// @param[in] orig_spec /// The original source file path to try and remap. /// /// @param[out] new_spec /// The newly remapped filespec that is guaranteed to exist. /// /// @return /// /b true if \a orig_spec was successfully located and /// \a new_spec is filled in with an existing file spec, /// \b false otherwise. //------------------------------------------------------------------ bool FindSourceFile(const FileSpec &orig_spec, FileSpec &new_spec) const; //------------------------------------------------------------------ /// Remaps a source file given \a path into \a new_path. /// /// Remaps \a path if any source remappings match. This function /// does NOT stat the file system so it can be used in tight loops /// where debug info is being parsed. /// /// @param[in] path /// The original source file path to try and remap. /// /// @param[out] new_path /// The newly remapped filespec that is may or may not exist. /// /// @return /// /b true if \a path was successfully located and \a new_path /// is filled in with a new source path, \b false otherwise. //------------------------------------------------------------------ bool RemapSourceFile(llvm::StringRef path, std::string &new_path) const; bool RemapSourceFile(const char *, std::string &) const = delete; void ClearModuleDependentCaches(); void SetTypeSystemMap(const TypeSystemMap &type_system_map) { m_type_system_map = type_system_map; } //---------------------------------------------------------------------- /// @class LookupInfo Module.h "lldb/Core/Module.h" /// @brief A class that encapsulates name lookup information. /// /// Users can type a wide variety of partial names when setting /// breakpoints by name or when looking for functions by name. /// SymbolVendor and SymbolFile objects are only required to implement /// name lookup for function basenames and for fully mangled names. /// This means if the user types in a partial name, we must reduce this /// to a name lookup that will work with all SymbolFile objects. So we /// might reduce a name lookup to look for a basename, and then prune /// out any results that don't match. /// /// The "m_name" member variable represents the name as it was typed /// by the user. "m_lookup_name" will be the name we actually search /// for through the symbol or objects files. Lanaguage is included in /// case we need to filter results by language at a later date. The /// "m_name_type_mask" member variable tells us what kinds of names we /// are looking for and can help us prune out unwanted results. /// /// Function lookups are done in Module.cpp, ModuleList.cpp and in /// BreakpointResolverName.cpp and they all now use this class to do /// lookups correctly. //---------------------------------------------------------------------- class LookupInfo { public: LookupInfo() : m_name(), m_lookup_name(), m_language(lldb::eLanguageTypeUnknown), m_name_type_mask(0), m_match_name_after_lookup(false) {} LookupInfo(const ConstString &name, uint32_t name_type_mask, lldb::LanguageType language); const ConstString &GetName() const { return m_name; } void SetName(const ConstString &name) { m_name = name; } const ConstString &GetLookupName() const { return m_lookup_name; } void SetLookupName(const ConstString &name) { m_lookup_name = name; } uint32_t GetNameTypeMask() const { return m_name_type_mask; } void SetNameTypeMask(uint32_t mask) { m_name_type_mask = mask; } void Prune(SymbolContextList &sc_list, size_t start_idx) const; protected: ConstString m_name; ///< What the user originally typed ConstString m_lookup_name; ///< The actual name will lookup when calling in ///the object or symbol file lldb::LanguageType m_language; ///< Limit matches to only be for this language uint32_t m_name_type_mask; ///< One or more bits from lldb::FunctionNameType ///that indicate what kind of names we are ///looking for bool m_match_name_after_lookup; ///< If \b true, then demangled names that ///match will need to contain "m_name" in ///order to be considered a match }; protected: SwiftASTContext *GetSwiftASTContextNoCreate(); //------------------------------------------------------------------ // Member Variables //------------------------------------------------------------------ mutable std::recursive_mutex m_mutex; ///< A mutex to keep this object happy ///in multi-threaded environments. /// The modification time for this module when it was created. llvm::sys::TimePoint<> m_mod_time; ArchSpec m_arch; ///< The architecture for this module. UUID m_uuid; ///< Each module is assumed to have a unique identifier to help ///match it up to debug symbols. FileSpec m_file; ///< The file representation on disk for this module (if ///there is one). FileSpec m_platform_file; ///< The path to the module on the platform on which ///it is being debugged FileSpec m_remote_install_file; ///< If set when debugging on remote ///platforms, this module will be installed at ///this location FileSpec m_symfile_spec; ///< If this path is valid, then this is the file ///that _will_ be used as the symbol file for this ///module ConstString m_object_name; ///< The name an object within this module that is ///selected, or empty of the module is represented ///by \a m_file. uint64_t m_object_offset; llvm::sys::TimePoint<> m_object_mod_time; lldb::ObjectFileSP m_objfile_sp; ///< A shared pointer to the object file ///parser for this module as it may or may ///not be shared with the SymbolFile lldb::SymbolVendorUP m_symfile_ap; ///< A pointer to the symbol vendor for this module. std::vector<lldb::SymbolVendorUP> m_old_symfiles; ///< If anyone calls Module::SetSymbolFileFileSpec() and ///changes the symbol file, ///< we need to keep all old symbol files around in case anyone has type ///references to them TypeSystemMap m_type_system_map; ///< A map of any type systems associated ///with this module PathMappingList m_source_mappings; ///< Module specific source remappings for ///when you have debug info for a module ///that doesn't match where the sources ///currently are lldb::SectionListUP m_sections_ap; ///< Unified section list for module that ///is used by the ObjectFile and and ///ObjectFile instances for the debug info std::atomic<bool> m_did_load_objfile{false}; std::atomic<bool> m_did_load_symbol_vendor{false}; std::atomic<bool> m_did_parse_uuid{false}; mutable bool m_file_has_changed : 1, m_first_file_changed_log : 1; /// See if the module was modified after it /// was initially opened. //------------------------------------------------------------------ /// Resolve a file or load virtual address. /// /// Tries to resolve \a vm_addr as a file address (if \a /// vm_addr_is_file_addr is true) or as a load address if \a /// vm_addr_is_file_addr is false) in the symbol vendor. /// \a resolve_scope indicates what clients wish to resolve /// and can be used to limit the scope of what is parsed. /// /// @param[in] vm_addr /// The load virtual address to resolve. /// /// @param[in] vm_addr_is_file_addr /// If \b true, \a vm_addr is a file address, else \a vm_addr /// if a load address. /// /// @param[in] resolve_scope /// The scope that should be resolved (see /// SymbolContext::Scope). /// /// @param[out] so_addr /// The section offset based address that got resolved if /// any bits are returned. /// /// @param[out] sc // The symbol context that has objects filled in. Each bit /// in the \a resolve_scope pertains to a member in the \a sc. /// /// @return /// A integer that contains SymbolContext::Scope bits set for /// each item that was successfully resolved. /// /// @see SymbolContext::Scope //------------------------------------------------------------------ uint32_t ResolveSymbolContextForAddress(lldb::addr_t vm_addr, bool vm_addr_is_file_addr, uint32_t resolve_scope, Address &so_addr, SymbolContext &sc); void SymbolIndicesToSymbolContextList(Symtab *symtab, std::vector<uint32_t> &symbol_indexes, SymbolContextList &sc_list); bool SetArchitecture(const ArchSpec &new_arch); SectionList *GetUnifiedSectionList(); friend class ModuleList; friend class ObjectFile; friend class SymbolFile; private: Module(); // Only used internally by CreateJITModule () size_t FindTypes_Impl( const SymbolContext &sc, const ConstString &name, const CompilerDeclContext *parent_decl_ctx, bool append, size_t max_matches, llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files, TypeMap &types); DISALLOW_COPY_AND_ASSIGN(Module); }; } // namespace lldb_private #endif // liblldb_Module_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/clang/test/Misc/ast-dump-decl.c
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump -ast-dump-filter Test %s | FileCheck -check-prefix CHECK -strict-whitespace %s // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck -check-prefix CHECK-TU -strict-whitespace %s int TestLocation; // CHECK: VarDecl 0x{{[^ ]*}} <{{.*}}:4:1, col:5> col:5 TestLocation struct TestIndent { int x; }; // CHECK: {{^}}RecordDecl{{.*TestIndent[^()]*$}} // CHECK-NEXT: {{^}}`-FieldDecl{{.*x[^()]*$}} struct TestChildren { int x; struct y { int z; }; }; // CHECK: RecordDecl{{.*}}TestChildren // CHECK-NEXT: FieldDecl{{.*}}x // CHECK-NEXT: RecordDecl{{.*}}y // CHECK-NEXT: FieldDecl{{.*}}z // CHECK-TU: TranslationUnitDecl void testLabelDecl() { __label__ TestLabelDecl; TestLabelDecl: goto TestLabelDecl; } // CHECK: LabelDecl{{.*}} TestLabelDecl typedef int TestTypedefDecl; // CHECK: TypedefDecl{{.*}} TestTypedefDecl 'int' __module_private__ typedef int TestTypedefDeclPrivate; // CHECK: TypedefDecl{{.*}} TestTypedefDeclPrivate 'int' __module_private__ enum TestEnumDecl { testEnumDecl }; // CHECK: EnumDecl{{.*}} TestEnumDecl // CHECK-NEXT: EnumConstantDecl{{.*}} testEnumDecl struct TestEnumDeclAnon { enum { testEnumDeclAnon } e; }; // CHECK: RecordDecl{{.*}} TestEnumDeclAnon // CHECK-NEXT: EnumDecl{{.*> .*$}} enum TestEnumDeclForward; // CHECK: EnumDecl{{.*}} TestEnumDeclForward __module_private__ enum TestEnumDeclPrivate; // CHECK: EnumDecl{{.*}} TestEnumDeclPrivate __module_private__ struct TestRecordDecl { int i; }; // CHECK: RecordDecl{{.*}} struct TestRecordDecl // CHECK-NEXT: FieldDecl struct TestRecordDeclEmpty { }; // CHECK: RecordDecl{{.*}} struct TestRecordDeclEmpty struct TestRecordDeclAnon1 { struct { } testRecordDeclAnon1; }; // CHECK: RecordDecl{{.*}} struct TestRecordDeclAnon1 // CHECK-NEXT: RecordDecl{{.*}} struct struct TestRecordDeclAnon2 { struct { }; }; // CHECK: RecordDecl{{.*}} struct TestRecordDeclAnon2 // CHECK-NEXT: RecordDecl{{.*}} struct struct TestRecordDeclForward; // CHECK: RecordDecl{{.*}} struct TestRecordDeclForward __module_private__ struct TestRecordDeclPrivate; // CHECK: RecordDecl{{.*}} struct TestRecordDeclPrivate __module_private__ enum testEnumConstantDecl { TestEnumConstantDecl, TestEnumConstantDeclInit = 1 }; // CHECK: EnumConstantDecl{{.*}} TestEnumConstantDecl 'int' // CHECK: EnumConstantDecl{{.*}} TestEnumConstantDeclInit 'int' // CHECK-NEXT: IntegerLiteral struct testIndirectFieldDecl { struct { int TestIndirectFieldDecl; }; }; // CHECK: IndirectFieldDecl{{.*}} TestIndirectFieldDecl 'int' // CHECK-NEXT: Field{{.*}} '' // CHECK-NEXT: Field{{.*}} 'TestIndirectFieldDecl' // FIXME: It would be nice to dump the enum and its enumerators. int TestFunctionDecl(int x, enum { e } y) { return x; } // CHECK: FunctionDecl{{.*}} TestFunctionDecl 'int (int, enum {{.*}})' // CHECK-NEXT: ParmVarDecl{{.*}} x // CHECK-NEXT: ParmVarDecl{{.*}} y // CHECK-NEXT: CompoundStmt // FIXME: It would be nice to 'Enum' and 'e'. int TestFunctionDecl2(enum Enum { e } x) { return x; } // CHECK: FunctionDecl{{.*}} TestFunctionDecl2 'int (enum {{.*}})' // CHECK-NEXT: ParmVarDecl{{.*}} x // CHECK-NEXT: CompoundStmt int TestFunctionDeclProto(int x); // CHECK: FunctionDecl{{.*}} TestFunctionDeclProto 'int (int)' // CHECK-NEXT: ParmVarDecl{{.*}} x extern int TestFunctionDeclSC(); // CHECK: FunctionDecl{{.*}} TestFunctionDeclSC 'int ()' extern inline int TestFunctionDeclInline(); // CHECK: FunctionDecl{{.*}} TestFunctionDeclInline 'int ()' inline struct testFieldDecl { int TestFieldDecl; int TestFieldDeclWidth : 1; __module_private__ int TestFieldDeclPrivate; }; // CHECK: FieldDecl{{.*}} TestFieldDecl 'int' // CHECK: FieldDecl{{.*}} TestFieldDeclWidth 'int' // CHECK-NEXT: IntegerLiteral // CHECK: FieldDecl{{.*}} TestFieldDeclPrivate 'int' __module_private__ int TestVarDecl; // CHECK: VarDecl{{.*}} TestVarDecl 'int' extern int TestVarDeclSC; // CHECK: VarDecl{{.*}} TestVarDeclSC 'int' extern __thread int TestVarDeclThread; // CHECK: VarDecl{{.*}} TestVarDeclThread 'int' tls{{$}} __module_private__ int TestVarDeclPrivate; // CHECK: VarDecl{{.*}} TestVarDeclPrivate 'int' __module_private__ int TestVarDeclInit = 0; // CHECK: VarDecl{{.*}} TestVarDeclInit 'int' // CHECK-NEXT: IntegerLiteral void testParmVarDecl(int TestParmVarDecl); // CHECK: ParmVarDecl{{.*}} TestParmVarDecl 'int'
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/main.c
<filename>SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/macosx/debug-info/apple_types/main.c<gh_stars>100-1000 //===-- main.c --------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// int main (int argc, char const *argv[]) { struct point_tag { int x; int y; }; // Set break point at this line. struct rect_tag { struct point_tag bottom_left; struct point_tag top_right; }; struct point_tag pt = { 2, 3 }; // This is the first executable statement. struct rect_tag rect = {{1,2}, {3,4}}; pt.x = argc; pt.y = argc * argc; rect.top_right.x = rect.top_right.x + argc; rect.top_right.y = rect.top_right.y + argc; return 0; }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/PosixApi.h
//===-- PosixApi.h ----------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Host_PosixApi_h #define liblldb_Host_PosixApi_h // This file defines platform specific functions, macros, and types necessary // to provide a minimum level of compatibility across all platforms to rely // on various posix api functionality. #include "llvm/Support/Compiler.h" #if defined(LLVM_ON_WIN32) #include "lldb/Host/windows/PosixApi.h" #endif #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/swift-integration-tests/test-lldb-with-c-package/CFoo/foo.c
#include "foo.h" int foo() { return 5; }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/ThreadLauncher.h
//===-- ThreadLauncher.h -----------------------------------------*- C++ //-*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef lldb_Host_ThreadLauncher_h_ #define lldb_Host_ThreadLauncher_h_ #include "lldb/Core/Error.h" #include "lldb/Host/HostThread.h" #include "lldb/lldb-types.h" #include "llvm/ADT/StringRef.h" namespace lldb_private { class ThreadLauncher { public: static HostThread LaunchThread(llvm::StringRef name, lldb::thread_func_t thread_function, lldb::thread_arg_t thread_arg, Error *error_ptr, size_t min_stack_byte_size = 0); // Minimum stack size in bytes, // set stack size to zero for // default platform thread stack // size struct HostThreadCreateInfo { std::string thread_name; lldb::thread_func_t thread_fptr; lldb::thread_arg_t thread_arg; HostThreadCreateInfo(const char *name, lldb::thread_func_t fptr, lldb::thread_arg_t arg) : thread_name(name ? name : ""), thread_fptr(fptr), thread_arg(arg) {} }; }; } #endif
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/SymbolFile/Symtab/SymbolFileSymtab.h
//===-- SymbolFileSymtab.h --------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_SymbolFileSymtab_h_ #define liblldb_SymbolFileSymtab_h_ // C Includes // C++ Includes #include <vector> // Other libraries and framework includes // Project includes #include "lldb/Symbol/SymbolFile.h" #include "lldb/Symbol/Symtab.h" class SymbolFileSymtab : public lldb_private::SymbolFile { public: //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ SymbolFileSymtab(lldb_private::ObjectFile *obj_file); ~SymbolFileSymtab() override; //------------------------------------------------------------------ // Static Functions //------------------------------------------------------------------ static void Initialize(); static void Terminate(); static lldb_private::ConstString GetPluginNameStatic(); static const char *GetPluginDescriptionStatic(); static lldb_private::SymbolFile * CreateInstance(lldb_private::ObjectFile *obj_file); uint32_t CalculateAbilities() override; //------------------------------------------------------------------ // Compile Unit function calls //------------------------------------------------------------------ uint32_t GetNumCompileUnits() override; lldb::CompUnitSP ParseCompileUnitAtIndex(uint32_t index) override; lldb::LanguageType ParseCompileUnitLanguage(const lldb_private::SymbolContext &sc) override; size_t ParseCompileUnitFunctions(const lldb_private::SymbolContext &sc) override; bool ParseCompileUnitLineTable(const lldb_private::SymbolContext &sc) override; bool ParseCompileUnitDebugMacros(const lldb_private::SymbolContext &sc) override; bool ParseCompileUnitSupportFiles( const lldb_private::SymbolContext &sc, lldb_private::FileSpecList &support_files) override; bool ParseImportedModules( const lldb_private::SymbolContext &sc, std::vector<lldb_private::ConstString> &imported_modules) override; size_t ParseFunctionBlocks(const lldb_private::SymbolContext &sc) override; size_t ParseTypes(const lldb_private::SymbolContext &sc) override; size_t ParseVariablesForContext(const lldb_private::SymbolContext &sc) override; lldb_private::Type *ResolveTypeUID(lldb::user_id_t type_uid) override; bool CompleteType(lldb_private::CompilerType &compiler_type) override; uint32_t ResolveSymbolContext(const lldb_private::Address &so_addr, uint32_t resolve_scope, lldb_private::SymbolContext &sc) override; size_t GetTypes(lldb_private::SymbolContextScope *sc_scope, uint32_t type_mask, lldb_private::TypeList &type_list) override; //------------------------------------------------------------------ // PluginInterface protocol //------------------------------------------------------------------ lldb_private::ConstString GetPluginName() override; uint32_t GetPluginVersion() override; protected: typedef std::map<lldb_private::ConstString, lldb::TypeSP> TypeMap; lldb_private::Symtab::IndexCollection m_source_indexes; lldb_private::Symtab::IndexCollection m_func_indexes; lldb_private::Symtab::IndexCollection m_code_indexes; lldb_private::Symtab::IndexCollection m_data_indexes; lldb_private::Symtab::NameToIndexMap m_objc_class_name_to_index; TypeMap m_objc_class_types; private: DISALLOW_COPY_AND_ASSIGN(SymbolFileSymtab); }; #endif // liblldb_SymbolFileSymtab_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerLLGS.h
<gh_stars>100-1000 //===-- GDBRemoteCommunicationServerLLGS.h ----------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_GDBRemoteCommunicationServerLLGS_h_ #define liblldb_GDBRemoteCommunicationServerLLGS_h_ // C Includes // C++ Includes #include <mutex> #include <unordered_map> // Other libraries and framework includes #include "lldb/Core/Communication.h" #include "lldb/Host/MainLoop.h" #include "lldb/Host/common/NativeProcessProtocol.h" #include "lldb/lldb-private-forward.h" // Project includes #include "GDBRemoteCommunicationServerCommon.h" class StringExtractorGDBRemote; namespace lldb_private { namespace process_gdb_remote { class ProcessGDBRemote; class GDBRemoteCommunicationServerLLGS : public GDBRemoteCommunicationServerCommon, public NativeProcessProtocol::NativeDelegate { public: //------------------------------------------------------------------ // Constructors and Destructors //------------------------------------------------------------------ GDBRemoteCommunicationServerLLGS(MainLoop &mainloop); //------------------------------------------------------------------ /// Specify the program to launch and its arguments. /// /// @param[in] args /// The command line to launch. /// /// @param[in] argc /// The number of elements in the args array of cstring pointers. /// /// @return /// An Error object indicating the success or failure of making /// the setting. //------------------------------------------------------------------ Error SetLaunchArguments(const char *const args[], int argc); //------------------------------------------------------------------ /// Specify the launch flags for the process. /// /// @param[in] launch_flags /// The launch flags to use when launching this process. /// /// @return /// An Error object indicating the success or failure of making /// the setting. //------------------------------------------------------------------ Error SetLaunchFlags(unsigned int launch_flags); //------------------------------------------------------------------ /// Launch a process with the current launch settings. /// /// This method supports running an lldb-gdbserver or similar /// server in a situation where the startup code has been provided /// with all the information for a child process to be launched. /// /// @return /// An Error object indicating the success or failure of the /// launch. //------------------------------------------------------------------ Error LaunchProcess() override; //------------------------------------------------------------------ /// Attach to a process. /// /// This method supports attaching llgs to a process accessible via the /// configured Platform. /// /// @return /// An Error object indicating the success or failure of the /// attach operation. //------------------------------------------------------------------ Error AttachToProcess(lldb::pid_t pid); //------------------------------------------------------------------ // NativeProcessProtocol::NativeDelegate overrides //------------------------------------------------------------------ void InitializeDelegate(NativeProcessProtocol *process) override; void ProcessStateChanged(NativeProcessProtocol *process, lldb::StateType state) override; void DidExec(NativeProcessProtocol *process) override; Error InitializeConnection(std::unique_ptr<Connection> &&connection); protected: MainLoop &m_mainloop; MainLoop::ReadHandleUP m_network_handle_up; lldb::tid_t m_current_tid; lldb::tid_t m_continue_tid; std::recursive_mutex m_debugged_process_mutex; NativeProcessProtocolSP m_debugged_process_sp; Communication m_stdio_communication; MainLoop::ReadHandleUP m_stdio_handle_up; lldb::StateType m_inferior_prev_state; lldb::DataBufferSP m_active_auxv_buffer_sp; std::mutex m_saved_registers_mutex; std::unordered_map<uint32_t, lldb::DataBufferSP> m_saved_registers_map; uint32_t m_next_saved_registers_id; bool m_handshake_completed : 1; PacketResult SendONotification(const char *buffer, uint32_t len); PacketResult SendWResponse(NativeProcessProtocol *process); PacketResult SendStopReplyPacketForThread(lldb::tid_t tid); PacketResult SendStopReasonForState(lldb::StateType process_state); PacketResult Handle_k(StringExtractorGDBRemote &packet); PacketResult Handle_qProcessInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qC(StringExtractorGDBRemote &packet); PacketResult Handle_QSetDisableASLR(StringExtractorGDBRemote &packet); PacketResult Handle_QSetWorkingDir(StringExtractorGDBRemote &packet); PacketResult Handle_qGetWorkingDir(StringExtractorGDBRemote &packet); PacketResult Handle_C(StringExtractorGDBRemote &packet); PacketResult Handle_c(StringExtractorGDBRemote &packet); PacketResult Handle_vCont(StringExtractorGDBRemote &packet); PacketResult Handle_vCont_actions(StringExtractorGDBRemote &packet); PacketResult Handle_stop_reason(StringExtractorGDBRemote &packet); PacketResult Handle_qRegisterInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qfThreadInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qsThreadInfo(StringExtractorGDBRemote &packet); PacketResult Handle_p(StringExtractorGDBRemote &packet); PacketResult Handle_P(StringExtractorGDBRemote &packet); PacketResult Handle_H(StringExtractorGDBRemote &packet); PacketResult Handle_I(StringExtractorGDBRemote &packet); PacketResult Handle_interrupt(StringExtractorGDBRemote &packet); // Handles $m and $x packets. PacketResult Handle_memory_read(StringExtractorGDBRemote &packet); PacketResult Handle_M(StringExtractorGDBRemote &packet); PacketResult Handle_qMemoryRegionInfoSupported(StringExtractorGDBRemote &packet); PacketResult Handle_qMemoryRegionInfo(StringExtractorGDBRemote &packet); PacketResult Handle_Z(StringExtractorGDBRemote &packet); PacketResult Handle_z(StringExtractorGDBRemote &packet); PacketResult Handle_s(StringExtractorGDBRemote &packet); PacketResult Handle_qXfer_auxv_read(StringExtractorGDBRemote &packet); PacketResult Handle_QSaveRegisterState(StringExtractorGDBRemote &packet); PacketResult Handle_QRestoreRegisterState(StringExtractorGDBRemote &packet); PacketResult Handle_vAttach(StringExtractorGDBRemote &packet); PacketResult Handle_D(StringExtractorGDBRemote &packet); PacketResult Handle_qThreadStopInfo(StringExtractorGDBRemote &packet); PacketResult Handle_jThreadsInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qWatchpointSupportInfo(StringExtractorGDBRemote &packet); PacketResult Handle_qFileLoadAddress(StringExtractorGDBRemote &packet); void SetCurrentThreadID(lldb::tid_t tid); lldb::tid_t GetCurrentThreadID() const; void SetContinueThreadID(lldb::tid_t tid); lldb::tid_t GetContinueThreadID() const { return m_continue_tid; } Error SetSTDIOFileDescriptor(int fd); FileSpec FindModuleFile(const std::string &module_path, const ArchSpec &arch) override; private: void HandleInferiorState_Exited(NativeProcessProtocol *process); void HandleInferiorState_Stopped(NativeProcessProtocol *process); NativeThreadProtocolSP GetThreadFromSuffix(StringExtractorGDBRemote &packet); uint32_t GetNextSavedRegistersID(); void MaybeCloseInferiorTerminalConnection(); void ClearProcessSpecificData(); void RegisterPacketHandlers(); void DataAvailableCallback(); void SendProcessOutput(); void StartSTDIOForwarding(); void StopSTDIOForwarding(); //------------------------------------------------------------------ // For GDBRemoteCommunicationServerLLGS only //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(GDBRemoteCommunicationServerLLGS); }; } // namespace process_gdb_remote } // namespace lldb_private #endif // liblldb_GDBRemoteCommunicationServerLLGS_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/tools/debugserver/source/MacOSX/MachProcess.h
//===-- MachProcess.h -------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// // // Created by <NAME> on 6/15/07. // //===----------------------------------------------------------------------===// #ifndef __MachProcess_h__ #define __MachProcess_h__ #include <CoreFoundation/CoreFoundation.h> #include <mach-o/loader.h> #include <mach/mach.h> #include <pthread.h> #include <sys/signal.h> #include <uuid/uuid.h> #include <vector> #include "DNBBreakpoint.h" #include "DNBDefs.h" #include "DNBError.h" #include "DNBThreadResumeActions.h" #include "Genealogy.h" #include "JSONGenerator.h" #include "MachException.h" #include "MachTask.h" #include "MachThreadList.h" #include "MachVMMemory.h" #include "PThreadCondition.h" #include "PThreadEvent.h" #include "PThreadMutex.h" #include "ThreadInfo.h" class DNBThreadResumeActions; class MachProcess { public: //---------------------------------------------------------------------- // Constructors and Destructors //---------------------------------------------------------------------- MachProcess(); ~MachProcess(); // A structure that can hold everything debugserver needs to know from // a binary's Mach-O header / load commands. struct mach_o_segment { std::string name; uint64_t vmaddr; uint64_t vmsize; uint64_t fileoff; uint64_t filesize; uint64_t maxprot; uint64_t initprot; uint64_t nsects; uint64_t flags; }; struct mach_o_information { struct mach_header_64 mach_header; std::vector<struct mach_o_segment> segments; uuid_t uuid; std::string min_version_os_name; std::string min_version_os_version; }; struct binary_image_information { std::string filename; uint64_t load_address; uint64_t mod_date; // may not be available - 0 if so struct mach_o_information macho_info; binary_image_information() : filename(), load_address(INVALID_NUB_ADDRESS), mod_date(0) {} }; //---------------------------------------------------------------------- // Child process control //---------------------------------------------------------------------- pid_t AttachForDebug(pid_t pid, char *err_str, size_t err_len); pid_t LaunchForDebug(const char *path, char const *argv[], char const *envp[], const char *working_directory, const char *stdin_path, const char *stdout_path, const char *stderr_path, bool no_stdio, nub_launch_flavor_t launch_flavor, int disable_aslr, const char *event_data, DNBError &err); static uint32_t GetCPUTypeForLocalProcess(pid_t pid); static pid_t ForkChildForPTraceDebugging(const char *path, char const *argv[], char const *envp[], MachProcess *process, DNBError &err); static pid_t PosixSpawnChildForPTraceDebugging( const char *path, cpu_type_t cpu_type, char const *argv[], char const *envp[], const char *working_directory, const char *stdin_path, const char *stdout_path, const char *stderr_path, bool no_stdio, MachProcess *process, int disable_aslr, DNBError &err); nub_addr_t GetDYLDAllImageInfosAddress(); static const void *PrepareForAttach(const char *path, nub_launch_flavor_t launch_flavor, bool waitfor, DNBError &err_str); static void CleanupAfterAttach(const void *attach_token, nub_launch_flavor_t launch_flavor, bool success, DNBError &err_str); static nub_process_t CheckForProcess(const void *attach_token, nub_launch_flavor_t launch_flavor); #if defined(WITH_BKS) || defined(WITH_FBS) pid_t BoardServiceLaunchForDebug(const char *app_bundle_path, char const *argv[], char const *envp[], bool no_stdio, bool disable_aslr, const char *event_data, DNBError &launch_err); pid_t BoardServiceForkChildForPTraceDebugging( const char *path, char const *argv[], char const *envp[], bool no_stdio, bool disable_aslr, const char *event_data, DNBError &launch_err); bool BoardServiceSendEvent(const char *event, DNBError &error); #endif static bool GetOSVersionNumbers(uint64_t *major, uint64_t *minor, uint64_t *patch); #ifdef WITH_BKS static void BKSCleanupAfterAttach(const void *attach_token, DNBError &err_str); #endif // WITH_BKS #ifdef WITH_FBS static void FBSCleanupAfterAttach(const void *attach_token, DNBError &err_str); #endif // WITH_FBS #ifdef WITH_SPRINGBOARD pid_t SBLaunchForDebug(const char *app_bundle_path, char const *argv[], char const *envp[], bool no_stdio, bool disable_aslr, DNBError &launch_err); static pid_t SBForkChildForPTraceDebugging(const char *path, char const *argv[], char const *envp[], bool no_stdio, MachProcess *process, DNBError &launch_err); #endif // WITH_SPRINGBOARD nub_addr_t LookupSymbol(const char *name, const char *shlib); void SetNameToAddressCallback(DNBCallbackNameToAddress callback, void *baton) { m_name_to_addr_callback = callback; m_name_to_addr_baton = baton; } void SetSharedLibraryInfoCallback(DNBCallbackCopyExecutableImageInfos callback, void *baton) { m_image_infos_callback = callback; m_image_infos_baton = baton; } bool Resume(const DNBThreadResumeActions &thread_actions); bool Signal(int signal, const struct timespec *timeout_abstime = NULL); bool Interrupt(); bool SendEvent(const char *event, DNBError &send_err); bool Kill(const struct timespec *timeout_abstime = NULL); bool Detach(); nub_size_t ReadMemory(nub_addr_t addr, nub_size_t size, void *buf); nub_size_t WriteMemory(nub_addr_t addr, nub_size_t size, const void *buf); //---------------------------------------------------------------------- // Path and arg accessors //---------------------------------------------------------------------- const char *Path() const { return m_path.c_str(); } size_t ArgumentCount() const { return m_args.size(); } const char *ArgumentAtIndex(size_t arg_idx) const { if (arg_idx < m_args.size()) return m_args[arg_idx].c_str(); return NULL; } //---------------------------------------------------------------------- // Breakpoint functions //---------------------------------------------------------------------- DNBBreakpoint *CreateBreakpoint(nub_addr_t addr, nub_size_t length, bool hardware); bool DisableBreakpoint(nub_addr_t addr, bool remove); void DisableAllBreakpoints(bool remove); bool EnableBreakpoint(nub_addr_t addr); DNBBreakpointList &Breakpoints() { return m_breakpoints; } const DNBBreakpointList &Breakpoints() const { return m_breakpoints; } //---------------------------------------------------------------------- // Watchpoint functions //---------------------------------------------------------------------- DNBBreakpoint *CreateWatchpoint(nub_addr_t addr, nub_size_t length, uint32_t watch_type, bool hardware); bool DisableWatchpoint(nub_addr_t addr, bool remove); void DisableAllWatchpoints(bool remove); bool EnableWatchpoint(nub_addr_t addr); uint32_t GetNumSupportedHardwareWatchpoints() const; DNBBreakpointList &Watchpoints() { return m_watchpoints; } const DNBBreakpointList &Watchpoints() const { return m_watchpoints; } //---------------------------------------------------------------------- // Exception thread functions //---------------------------------------------------------------------- bool StartSTDIOThread(); static void *STDIOThread(void *arg); void ExceptionMessageReceived(const MachException::Message &exceptionMessage); task_t ExceptionMessageBundleComplete(); void SharedLibrariesUpdated(); nub_size_t CopyImageInfos(struct DNBExecutableImageInfo **image_infos, bool only_changed); //---------------------------------------------------------------------- // Profile functions //---------------------------------------------------------------------- void SetEnableAsyncProfiling(bool enable, uint64_t internal_usec, DNBProfileDataScanType scan_type); bool IsProfilingEnabled() { return m_profile_enabled; } useconds_t ProfileInterval() { return m_profile_interval_usec; } bool StartProfileThread(); static void *ProfileThread(void *arg); void SignalAsyncProfileData(const char *info); size_t GetAsyncProfileData(char *buf, size_t buf_size); //---------------------------------------------------------------------- // Accessors //---------------------------------------------------------------------- pid_t ProcessID() const { return m_pid; } bool ProcessIDIsValid() const { return m_pid > 0; } pid_t SetProcessID(pid_t pid); MachTask &Task() { return m_task; } const MachTask &Task() const { return m_task; } PThreadEvent &Events() { return m_events; } const DNBRegisterSetInfo *GetRegisterSetInfo(nub_thread_t tid, nub_size_t *num_reg_sets) const; bool GetRegisterValue(nub_thread_t tid, uint32_t set, uint32_t reg, DNBRegisterValue *reg_value) const; bool SetRegisterValue(nub_thread_t tid, uint32_t set, uint32_t reg, const DNBRegisterValue *value) const; nub_bool_t SyncThreadState(nub_thread_t tid); const char *ThreadGetName(nub_thread_t tid); nub_state_t ThreadGetState(nub_thread_t tid); ThreadInfo::QoS GetRequestedQoS(nub_thread_t tid, nub_addr_t tsd, uint64_t dti_qos_class_index); nub_addr_t GetPThreadT(nub_thread_t tid); nub_addr_t GetDispatchQueueT(nub_thread_t tid); nub_addr_t GetTSDAddressForThread(nub_thread_t tid, uint64_t plo_pthread_tsd_base_address_offset, uint64_t plo_pthread_tsd_base_offset, uint64_t plo_pthread_tsd_entry_size); bool GetMachOInformationFromMemory(nub_addr_t mach_o_header_addr, int wordsize, struct mach_o_information &inf); JSONGenerator::ObjectSP FormatDynamicLibrariesIntoJSON( const std::vector<struct binary_image_information> &image_infos); void GetAllLoadedBinariesViaDYLDSPI( std::vector<struct binary_image_information> &image_infos); JSONGenerator::ObjectSP GetLoadedDynamicLibrariesInfos( nub_process_t pid, nub_addr_t image_list_address, nub_addr_t image_count); JSONGenerator::ObjectSP GetLibrariesInfoForAddresses(nub_process_t pid, std::vector<uint64_t> &macho_addresses); JSONGenerator::ObjectSP GetAllLoadedLibrariesInfos(nub_process_t pid); JSONGenerator::ObjectSP GetSharedCacheInfo(nub_process_t pid); nub_size_t GetNumThreads() const; nub_thread_t GetThreadAtIndex(nub_size_t thread_idx) const; nub_thread_t GetCurrentThread(); nub_thread_t GetCurrentThreadMachPort(); nub_thread_t SetCurrentThread(nub_thread_t tid); MachThreadList &GetThreadList() { return m_thread_list; } bool GetThreadStoppedReason(nub_thread_t tid, struct DNBThreadStopInfo *stop_info); void DumpThreadStoppedReason(nub_thread_t tid) const; const char *GetThreadInfo(nub_thread_t tid) const; nub_thread_t GetThreadIDForMachPortNumber(thread_t mach_port_number) const; uint32_t GetCPUType(); nub_state_t GetState(); void SetState(nub_state_t state); bool IsRunning(nub_state_t state) { return state == eStateRunning || IsStepping(state); } bool IsStepping(nub_state_t state) { return state == eStateStepping; } bool CanResume(nub_state_t state) { return state == eStateStopped; } bool GetExitStatus(int *status) { if (GetState() == eStateExited) { if (status) *status = m_exit_status; return true; } return false; } void SetExitStatus(int status) { m_exit_status = status; SetState(eStateExited); } const char *GetExitInfo() { return m_exit_info.c_str(); } void SetExitInfo(const char *info); uint32_t StopCount() const { return m_stop_count; } void SetChildFileDescriptors(int stdin_fileno, int stdout_fileno, int stderr_fileno) { m_child_stdin = stdin_fileno; m_child_stdout = stdout_fileno; m_child_stderr = stderr_fileno; } int GetStdinFileDescriptor() const { return m_child_stdin; } int GetStdoutFileDescriptor() const { return m_child_stdout; } int GetStderrFileDescriptor() const { return m_child_stderr; } void AppendSTDOUT(char *s, size_t len); size_t GetAvailableSTDOUT(char *buf, size_t buf_size); size_t GetAvailableSTDERR(char *buf, size_t buf_size); void CloseChildFileDescriptors() { if (m_child_stdin >= 0) { ::close(m_child_stdin); m_child_stdin = -1; } if (m_child_stdout >= 0) { ::close(m_child_stdout); m_child_stdout = -1; } if (m_child_stderr >= 0) { ::close(m_child_stderr); m_child_stderr = -1; } } bool ProcessUsingSpringBoard() const { return (m_flags & eMachProcessFlagsUsingSBS) != 0; } bool ProcessUsingBackBoard() const { return (m_flags & eMachProcessFlagsUsingBKS) != 0; } Genealogy::ThreadActivitySP GetGenealogyInfoForThread(nub_thread_t tid, bool &timed_out); Genealogy::ProcessExecutableInfoSP GetGenealogyImageInfo(size_t idx); DNBProfileDataScanType GetProfileScanType() { return m_profile_scan_type; } private: enum { eMachProcessFlagsNone = 0, eMachProcessFlagsAttached = (1 << 0), eMachProcessFlagsUsingSBS = (1 << 1), eMachProcessFlagsUsingBKS = (1 << 2), eMachProcessFlagsUsingFBS = (1 << 3) }; void Clear(bool detaching = false); void ReplyToAllExceptions(); void PrivateResume(); uint32_t Flags() const { return m_flags; } nub_state_t DoSIGSTOP(bool clear_bps_and_wps, bool allow_running, uint32_t *thread_idx_ptr); pid_t m_pid; // Process ID of child process cpu_type_t m_cpu_type; // The CPU type of this process int m_child_stdin; int m_child_stdout; int m_child_stderr; std::string m_path; // A path to the executable if we have one std::vector<std::string> m_args; // The arguments with which the process was lauched int m_exit_status; // The exit status for the process std::string m_exit_info; // Any extra info that we may have about the exit MachTask m_task; // The mach task for this process uint32_t m_flags; // Process specific flags (see eMachProcessFlags enums) uint32_t m_stop_count; // A count of many times have we stopped pthread_t m_stdio_thread; // Thread ID for the thread that watches for child // process stdio PThreadMutex m_stdio_mutex; // Multithreaded protection for stdio std::string m_stdout_data; bool m_profile_enabled; // A flag to indicate if profiling is enabled useconds_t m_profile_interval_usec; // If enable, the profiling interval in // microseconds DNBProfileDataScanType m_profile_scan_type; // Indicates what needs to be profiled pthread_t m_profile_thread; // Thread ID for the thread that profiles the inferior PThreadMutex m_profile_data_mutex; // Multithreaded protection for profile info data std::vector<std::string> m_profile_data; // Profile data, must be protected by m_profile_data_mutex DNBThreadResumeActions m_thread_actions; // The thread actions for the current // MachProcess::Resume() call MachException::Message::collection m_exception_messages; // A collection of // exception messages // caught when // listening to the // exception port PThreadMutex m_exception_messages_mutex; // Multithreaded protection for // m_exception_messages MachThreadList m_thread_list; // A list of threads that is maintained/updated // after each stop Genealogy m_activities; // A list of activities that is updated after every // stop lazily nub_state_t m_state; // The state of our process PThreadMutex m_state_mutex; // Multithreaded protection for m_state PThreadEvent m_events; // Process related events in the child processes // lifetime can be waited upon PThreadEvent m_private_events; // Used to coordinate running and stopping the // process without affecting m_events DNBBreakpointList m_breakpoints; // Breakpoint list for this process DNBBreakpointList m_watchpoints; // Watchpoint list for this process DNBCallbackNameToAddress m_name_to_addr_callback; void *m_name_to_addr_baton; DNBCallbackCopyExecutableImageInfos m_image_infos_callback; void *m_image_infos_baton; std::string m_bundle_id; // If we are a SB or BKS process, this will be our bundle ID. int m_sent_interrupt_signo; // When we call MachProcess::Interrupt(), we want // to send a single signal // to the inferior and only send the signal if we aren't already stopped. // If we end up sending a signal to stop the process we store it until we // receive an exception with this signal. This helps us to verify we got // the signal that interrupted the process. We might stop due to another // reason after an interrupt signal is sent, so this helps us ensure that // we don't report a spurious stop on the next resume. int m_auto_resume_signo; // If we resume the process and still haven't // received our interrupt signal // acknownledgement, we will shortly after the next resume. We store the // interrupt signal in this variable so when we get the interrupt signal // as the sole reason for the process being stopped, we can auto resume // the process. bool m_did_exec; void *(*m_dyld_process_info_create)(task_t task, uint64_t timestamp, kern_return_t *kernelError); void (*m_dyld_process_info_for_each_image)( void *info, void (^callback)(uint64_t machHeaderAddress, const uuid_t uuid, const char *path)); void (*m_dyld_process_info_release)(void *info); void (*m_dyld_process_info_get_cache)(void *info, void *cacheInfo); }; #endif // __MachProcess_h__
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/StringList.h
<filename>SymbolExtractorAndRenamer/lldb/include/lldb/Core/StringList.h //===-- StringList.h --------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_StringList_h_ #define liblldb_StringList_h_ // C Includes #include <stdint.h> // C++ Includes #include <string> // Other libraries and framework includes #include "llvm/ADT/StringRef.h" // Project includes #include "lldb/Core/STLUtils.h" #include "lldb/lldb-forward.h" namespace lldb_private { class StringList { public: StringList(); StringList(const char *str); StringList(const char **strv, int strc); virtual ~StringList(); void AppendString(const std::string &s); void AppendString(std::string &&s); void AppendString(const char *str); void AppendString(const char *str, size_t str_len); void AppendString(llvm::StringRef str); void AppendList(const char **strv, int strc); void AppendList(StringList strings); bool ReadFileLines(FileSpec &input_file); size_t GetSize() const; void SetSize(size_t n) { m_strings.resize(n); } size_t GetMaxStringLength() const; std::string &operator[](size_t idx) { // No bounds checking, verify "idx" is good prior to calling this function return m_strings[idx]; } const std::string &operator[](size_t idx) const { // No bounds checking, verify "idx" is good prior to calling this function return m_strings[idx]; } void PopBack() { m_strings.pop_back(); } const char *GetStringAtIndex(size_t idx) const; void Join(const char *separator, Stream &strm); void Clear(); void LongestCommonPrefix(std::string &common_prefix); void InsertStringAtIndex(size_t idx, const std::string &str); void InsertStringAtIndex(size_t idx, std::string &&str); void InsertStringAtIndex(size_t id, const char *str); void DeleteStringAtIndex(size_t id); void RemoveBlankLines(); size_t SplitIntoLines(const std::string &lines); size_t SplitIntoLines(const char *lines, size_t len); std::string CopyList(const char *item_preamble = nullptr, const char *items_sep = "\n") const; StringList &operator<<(const char *str); StringList &operator<<(const std::string &s); StringList &operator<<(StringList strings); // Copy assignment for a vector of strings StringList &operator=(const std::vector<std::string> &rhs); // This string list contains a list of valid auto completion // strings, and the "s" is passed in. "matches" is filled in // with zero or more string values that start with "s", and // the first string to exactly match one of the string // values in this collection, will have "exact_matches_idx" // filled in to match the index, or "exact_matches_idx" will // have SIZE_MAX size_t AutoComplete(llvm::StringRef s, StringList &matches, size_t &exact_matches_idx) const; // Dump the StringList to the given lldb_private::Log, `log`, one item per // line. // If given, `name` will be used to identify the start and end of the list in // the output. virtual void LogDump(Log *log, const char *name = nullptr); // Static helper to convert an iterable of strings to a StringList, and then // dump it with the semantics of the `LogDump` method. template <typename T> static void LogDump(Log *log, T s_iterable, const char *name = nullptr) { if (!log) return; // Make a copy of the iterable as a StringList StringList l{}; for (const auto &s : s_iterable) l << s; l.LogDump(log, name); } private: STLStringArray m_strings; }; } // namespace lldb_private #endif // liblldb_StringList_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/common/UDPSocket.h
<reponame>Polidea/SiriusObfuscator<gh_stars>100-1000 //===-- UDPSocket.h ---------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_UDPSocket_h_ #define liblldb_UDPSocket_h_ #include "lldb/Host/Socket.h" namespace lldb_private { class UDPSocket : public Socket { public: UDPSocket(bool child_processes_inherit, Error &error); static Error Connect(llvm::StringRef name, bool child_processes_inherit, Socket *&socket); private: UDPSocket(NativeSocket socket); size_t Send(const void *buf, const size_t num_bytes) override; Error Connect(llvm::StringRef name) override; Error Listen(llvm::StringRef name, int backlog) override; Error Accept(llvm::StringRef name, bool child_processes_inherit, Socket *&socket) override; SocketAddress m_sockaddr; }; } #endif // ifndef liblldb_UDPSocket_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/python_api/hello_world/main.c
<reponame>Polidea/SiriusObfuscator<filename>SymbolExtractorAndRenamer/lldb/packages/Python/lldbsuite/test/python_api/hello_world/main.c #include <stdio.h> int main(int argc, char const *argv[]) { lldb_enable_attach(); printf("Hello world.\n"); // Set break point at this line. if (argc == 1) return 0; // Waiting to be attached by the debugger, otherwise. char line[100]; while (fgets(line, sizeof(line), stdin)) { // Waiting to be attached... printf("input line=>%s\n", line); } printf("Exiting now\n"); }
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Host/common/NativeThreadProtocol.h
//===-- NativeThreadProtocol.h ----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_NativeThreadProtocol_h_ #define liblldb_NativeThreadProtocol_h_ #include <memory> #include "lldb/Host/Debug.h" #include "lldb/lldb-private-forward.h" #include "lldb/lldb-types.h" namespace lldb_private { //------------------------------------------------------------------ // NativeThreadProtocol //------------------------------------------------------------------ class NativeThreadProtocol : public std::enable_shared_from_this<NativeThreadProtocol> { public: NativeThreadProtocol(NativeProcessProtocol *process, lldb::tid_t tid); virtual ~NativeThreadProtocol() {} virtual std::string GetName() = 0; virtual lldb::StateType GetState() = 0; virtual NativeRegisterContextSP GetRegisterContext() = 0; virtual Error ReadRegister(uint32_t reg, RegisterValue &reg_value); virtual Error WriteRegister(uint32_t reg, const RegisterValue &reg_value); virtual Error SaveAllRegisters(lldb::DataBufferSP &data_sp); virtual Error RestoreAllRegisters(lldb::DataBufferSP &data_sp); virtual bool GetStopReason(ThreadStopInfo &stop_info, std::string &description) = 0; lldb::tid_t GetID() const { return m_tid; } NativeProcessProtocolSP GetProcess(); // --------------------------------------------------------------------- // Thread-specific watchpoints // --------------------------------------------------------------------- virtual Error SetWatchpoint(lldb::addr_t addr, size_t size, uint32_t watch_flags, bool hardware) = 0; virtual Error RemoveWatchpoint(lldb::addr_t addr) = 0; protected: NativeProcessProtocolWP m_process_wp; lldb::tid_t m_tid; }; } #endif // #ifndef liblldb_NativeThreadProtocol_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/source/Plugins/Process/Linux/NativeProcessLinux.h
//===-- NativeProcessLinux.h ---------------------------------- -*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_NativeProcessLinux_H_ #define liblldb_NativeProcessLinux_H_ // C++ Includes #include <unordered_set> // Other libraries and framework includes #include "lldb/Core/ArchSpec.h" #include "lldb/Host/Debug.h" #include "lldb/Host/FileSpec.h" #include "lldb/Host/HostThread.h" #include "lldb/Target/MemoryRegionInfo.h" #include "lldb/lldb-types.h" #include "NativeThreadLinux.h" #include "lldb/Host/common/NativeProcessProtocol.h" namespace lldb_private { class Error; class Scalar; namespace process_linux { /// @class NativeProcessLinux /// @brief Manages communication with the inferior (debugee) process. /// /// Upon construction, this class prepares and launches an inferior process for /// debugging. /// /// Changes in the inferior process state are broadcasted. class NativeProcessLinux : public NativeProcessProtocol { friend Error NativeProcessProtocol::Launch( ProcessLaunchInfo &launch_info, NativeDelegate &native_delegate, MainLoop &mainloop, NativeProcessProtocolSP &process_sp); friend Error NativeProcessProtocol::Attach( lldb::pid_t pid, NativeProcessProtocol::NativeDelegate &native_delegate, MainLoop &mainloop, NativeProcessProtocolSP &process_sp); public: // --------------------------------------------------------------------- // NativeProcessProtocol Interface // --------------------------------------------------------------------- Error Resume(const ResumeActionList &resume_actions) override; Error Halt() override; Error Detach() override; Error Signal(int signo) override; Error Interrupt() override; Error Kill() override; Error GetMemoryRegionInfo(lldb::addr_t load_addr, MemoryRegionInfo &range_info) override; Error ReadMemory(lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read) override; Error ReadMemoryWithoutTrap(lldb::addr_t addr, void *buf, size_t size, size_t &bytes_read) override; Error WriteMemory(lldb::addr_t addr, const void *buf, size_t size, size_t &bytes_written) override; Error AllocateMemory(size_t size, uint32_t permissions, lldb::addr_t &addr) override; Error DeallocateMemory(lldb::addr_t addr) override; lldb::addr_t GetSharedLibraryInfoAddress() override; size_t UpdateThreads() override; bool GetArchitecture(ArchSpec &arch) const override; Error SetBreakpoint(lldb::addr_t addr, uint32_t size, bool hardware) override; void DoStopIDBumped(uint32_t newBumpId) override; Error GetLoadedModuleFileSpec(const char *module_path, FileSpec &file_spec) override; Error GetFileLoadAddress(const llvm::StringRef &file_name, lldb::addr_t &load_addr) override; NativeThreadLinuxSP GetThreadByID(lldb::tid_t id); // --------------------------------------------------------------------- // Interface used by NativeRegisterContext-derived classes. // --------------------------------------------------------------------- static Error PtraceWrapper(int req, lldb::pid_t pid, void *addr = nullptr, void *data = nullptr, size_t data_size = 0, long *result = nullptr); bool SupportHardwareSingleStepping() const; protected: // --------------------------------------------------------------------- // NativeProcessProtocol protected interface // --------------------------------------------------------------------- Error GetSoftwareBreakpointTrapOpcode(size_t trap_opcode_size_hint, size_t &actual_opcode_size, const uint8_t *&trap_opcode_bytes) override; private: MainLoop::SignalHandleUP m_sigchld_handle; ArchSpec m_arch; LazyBool m_supports_mem_region; std::vector<std::pair<MemoryRegionInfo, FileSpec>> m_mem_region_cache; lldb::tid_t m_pending_notification_tid; // List of thread ids stepping with a breakpoint with the address of // the relevan breakpoint std::map<lldb::tid_t, lldb::addr_t> m_threads_stepping_with_breakpoint; // --------------------------------------------------------------------- // Private Instance Methods // --------------------------------------------------------------------- NativeProcessLinux(); Error LaunchInferior(MainLoop &mainloop, ProcessLaunchInfo &launch_info); /// Attaches to an existing process. Forms the /// implementation of Process::DoAttach void AttachToInferior(MainLoop &mainloop, lldb::pid_t pid, Error &error); ::pid_t Attach(lldb::pid_t pid, Error &error); static Error SetDefaultPtraceOpts(const lldb::pid_t); static void *MonitorThread(void *baton); void MonitorCallback(lldb::pid_t pid, bool exited, int signal, int status); void WaitForNewThread(::pid_t tid); void MonitorSIGTRAP(const siginfo_t &info, NativeThreadLinux &thread); void MonitorTrace(NativeThreadLinux &thread); void MonitorBreakpoint(NativeThreadLinux &thread); void MonitorWatchpoint(NativeThreadLinux &thread, uint32_t wp_index); void MonitorSignal(const siginfo_t &info, NativeThreadLinux &thread, bool exited); Error SetupSoftwareSingleStepping(NativeThreadLinux &thread); #if 0 static ::ProcessMessage::CrashReason GetCrashReasonForSIGSEGV(const siginfo_t *info); static ::ProcessMessage::CrashReason GetCrashReasonForSIGILL(const siginfo_t *info); static ::ProcessMessage::CrashReason GetCrashReasonForSIGFPE(const siginfo_t *info); static ::ProcessMessage::CrashReason GetCrashReasonForSIGBUS(const siginfo_t *info); #endif bool HasThreadNoLock(lldb::tid_t thread_id); bool StopTrackingThread(lldb::tid_t thread_id); NativeThreadLinuxSP AddThread(lldb::tid_t thread_id); Error GetSoftwareBreakpointPCOffset(uint32_t &actual_opcode_size); Error FixupBreakpointPCAsNeeded(NativeThreadLinux &thread); /// Writes a siginfo_t structure corresponding to the given thread ID to the /// memory region pointed to by @p siginfo. Error GetSignalInfo(lldb::tid_t tid, void *siginfo); /// Writes the raw event message code (vis-a-vis PTRACE_GETEVENTMSG) /// corresponding to the given thread ID to the memory pointed to by @p /// message. Error GetEventMessage(lldb::tid_t tid, unsigned long *message); void NotifyThreadDeath(lldb::tid_t tid); Error Detach(lldb::tid_t tid); // This method is requests a stop on all threads which are still running. It // sets up a // deferred delegate notification, which will fire once threads report as // stopped. The // triggerring_tid will be set as the current thread (main stop reason). void StopRunningThreads(lldb::tid_t triggering_tid); // Notify the delegate if all threads have stopped. void SignalIfAllThreadsStopped(); // Resume the given thread, optionally passing it the given signal. The type // of resume // operation (continue, single-step) depends on the state parameter. Error ResumeThread(NativeThreadLinux &thread, lldb::StateType state, int signo); void ThreadWasCreated(NativeThreadLinux &thread); void SigchldHandler(); Error PopulateMemoryRegionCache(); }; } // namespace process_linux } // namespace lldb_private #endif // #ifndef liblldb_NativeProcessLinux_H_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/State.h
//===-- State.h -------------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_State_h_ #define liblldb_State_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/lldb-private.h" namespace lldb_private { //------------------------------------------------------------------ /// Converts a StateType to a C string. /// /// @param[in] state /// The StateType object to convert. /// /// @return /// A NULL terminated C string that describes \a state. The /// returned string comes from constant string buffers and does /// not need to be freed. //------------------------------------------------------------------ const char *StateAsCString(lldb::StateType state); //------------------------------------------------------------------ /// Check if a state represents a state where the process or thread /// is running. /// /// @param[in] state /// The StateType enumeration value /// /// @return /// \b true if the state represents a process or thread state /// where the process or thread is running, \b false otherwise. //------------------------------------------------------------------ bool StateIsRunningState(lldb::StateType state); //------------------------------------------------------------------ /// Check if a state represents a state where the process or thread /// is stopped. Stopped can mean stopped when the process is still /// around, or stopped when the process has exited or doesn't exist /// yet. The \a must_exist argument tells us which of these cases is /// desired. /// /// @param[in] state /// The StateType enumeration value /// /// @param[in] must_exist /// A boolean that indicates the thread must also be alive /// so states like unloaded or exited won't return true. /// /// @return /// \b true if the state represents a process or thread state /// where the process or thread is stopped. If \a must_exist is /// \b true, then the process can't be exited or unloaded, /// otherwise exited and unloaded or other states where the /// process no longer exists are considered to be stopped. //------------------------------------------------------------------ bool StateIsStoppedState(lldb::StateType state, bool must_exist); const char *GetPermissionsAsCString(uint32_t permissions); } // namespace lldb_private #endif // liblldb_State_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/ValueObjectVariable.h
<reponame>Polidea/SiriusObfuscator //===-- ValueObjectVariable.h -----------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_ValueObjectVariable_h_ #define liblldb_ValueObjectVariable_h_ // C Includes // C++ Includes // Other libraries and framework includes // Project includes #include "lldb/Core/ValueObject.h" namespace lldb_private { //---------------------------------------------------------------------- // A ValueObject that contains a root variable that may or may not // have children. //---------------------------------------------------------------------- class ValueObjectVariable : public ValueObject { public: ~ValueObjectVariable() override; static lldb::ValueObjectSP Create(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp); uint64_t GetByteSize() override; ConstString GetTypeName() override; ConstString GetQualifiedTypeName() override; ConstString GetDisplayTypeName() override; size_t CalculateNumChildren(uint32_t max) override; lldb::ValueType GetValueType() const override; bool IsInScope() override; lldb::ModuleSP GetModule() override; SymbolContextScope *GetSymbolContextScope() override; bool GetDeclaration(Declaration &decl) override; const char *GetLocationAsCString() override; bool SetValueFromCString(const char *value_str, Error &error) override; bool SetData(DataExtractor &data, Error &error) override; virtual lldb::VariableSP GetVariable() override { return m_variable_sp; } protected: bool UpdateValue() override; CompilerType GetCompilerTypeImpl() override; lldb::VariableSP m_variable_sp; ///< The variable that this value object is based upon Value m_resolved_value; ///< The value that DWARFExpression resolves this ///variable to before we patch it up private: ValueObjectVariable(ExecutionContextScope *exe_scope, const lldb::VariableSP &var_sp); //------------------------------------------------------------------ // For ValueObject only //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(ValueObjectVariable); }; } // namespace lldb_private #endif // liblldb_ValueObjectVariable_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Core/EmulateInstruction.h
//===-- EmulateInstruction.h ------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef lldb_EmulateInstruction_h_ #define lldb_EmulateInstruction_h_ #include <string> #include "lldb/Core/ArchSpec.h" #include "lldb/Core/Opcode.h" #include "lldb/Core/PluginInterface.h" #include "lldb/Core/RegisterValue.h" #include "lldb/lldb-private.h" #include "lldb/lldb-public.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class EmulateInstruction EmulateInstruction.h /// "lldb/Core/EmulateInstruction.h" /// @brief A class that allows emulation of CPU opcodes. /// /// This class is a plug-in interface that is accessed through the /// standard static FindPlugin function call in the EmulateInstruction /// class. The FindPlugin takes a target triple and returns a new object /// if there is a plug-in that supports the architecture and OS. Four /// callbacks and a baton are provided. The four callbacks are read /// register, write register, read memory and write memory. /// /// This class is currently designed for these main use cases: /// - Auto generation of Call Frame Information (CFI) from assembly code /// - Predicting single step breakpoint locations /// - Emulating instructions for breakpoint traps /// /// Objects can be asked to read an instruction which will cause a call /// to the read register callback to get the PC, followed by a read /// memory call to read the opcode. If ReadInstruction () returns true, /// then a call to EmulateInstruction::EvaluateInstruction () can be /// made. At this point the EmulateInstruction subclass will use all of /// the callbacks to emulate an instruction. /// /// Clients that provide the callbacks can either do the read/write /// registers/memory to actually emulate the instruction on a real or /// virtual CPU, or watch for the EmulateInstruction::Context which /// is context for the read/write register/memory which explains why /// the callback is being called. Examples of a context are: /// "pushing register 3 onto the stack at offset -12", or "adjusting /// stack pointer by -16". This extra context allows the generation of /// CFI information from assembly code without having to actually do /// the read/write register/memory. /// /// Clients must be prepared that not all instructions for an /// Instruction Set Architecture (ISA) will be emulated. /// /// Subclasses at the very least should implement the instructions that /// save and restore registers onto the stack and adjustment to the stack /// pointer. By just implementing a few instructions for an ISA that are /// the typical prologue opcodes, you can then generate CFI using a /// class that will soon be available. /// /// Implementing all of the instructions that affect the PC can then /// allow single step prediction support. /// /// Implementing all of the instructions allows for emulation of opcodes /// for breakpoint traps and will pave the way for "thread centric" /// debugging. The current debugging model is "process centric" where /// all threads must be stopped when any thread is stopped; when /// hitting software breakpoints we must disable the breakpoint by /// restoring the original breakpoint opcode, single stepping and /// restoring the breakpoint trap. If all threads were allowed to run /// then other threads could miss the breakpoint. /// /// This class centralizes the code that usually is done in separate /// code paths in a debugger (single step prediction, finding save /// restore locations of registers for unwinding stack frame variables) /// and emulating the instruction is just a bonus. //---------------------------------------------------------------------- class EmulateInstruction : public PluginInterface { public: static EmulateInstruction *FindPlugin(const ArchSpec &arch, InstructionType supported_inst_type, const char *plugin_name); enum ContextType { eContextInvalid = 0, // Read an instruction opcode from memory eContextReadOpcode, // Usually used for writing a register value whose source value is an // immediate eContextImmediate, // Exclusively used when saving a register to the stack as part of the // prologue eContextPushRegisterOnStack, // Exclusively used when restoring a register off the stack as part of // the epilogue eContextPopRegisterOffStack, // Add or subtract a value from the stack eContextAdjustStackPointer, // Adjust the frame pointer for the current frame eContextSetFramePointer, // Typically in an epilogue sequence. Copy the frame pointer back // into the stack pointer, use SP for CFA calculations again. eContextRestoreStackPointer, // Add or subtract a value from a base address register (other than SP) eContextAdjustBaseRegister, // Add or subtract a value from the PC or store a value to the PC. eContextAdjustPC, // Used in WriteRegister callbacks to indicate where the eContextRegisterPlusOffset, // Used in WriteMemory callback to indicate where the data came from eContextRegisterStore, eContextRegisterLoad, // Used when performing a PC-relative branch where the eContextRelativeBranchImmediate, // Used when performing an absolute branch where the eContextAbsoluteBranchRegister, // Used when performing a supervisor call to an operating system to // provide a service: eContextSupervisorCall, // Used when performing a MemU operation to read the PC-relative offset // from an address. eContextTableBranchReadMemory, // Used when random bits are written into a register eContextWriteRegisterRandomBits, // Used when random bits are written to memory eContextWriteMemoryRandomBits, eContextArithmetic, eContextAdvancePC, eContextReturnFromException }; enum InfoType { eInfoTypeRegisterPlusOffset, eInfoTypeRegisterPlusIndirectOffset, eInfoTypeRegisterToRegisterPlusOffset, eInfoTypeRegisterToRegisterPlusIndirectOffset, eInfoTypeRegisterRegisterOperands, eInfoTypeOffset, eInfoTypeRegister, eInfoTypeImmediate, eInfoTypeImmediateSigned, eInfoTypeAddress, eInfoTypeISAAndImmediate, eInfoTypeISAAndImmediateSigned, eInfoTypeISA, eInfoTypeNoArgs } InfoType; struct Context { ContextType type; enum InfoType info_type; union { struct RegisterPlusOffset { RegisterInfo reg; // base register int64_t signed_offset; // signed offset added to base register } RegisterPlusOffset; struct RegisterPlusIndirectOffset { RegisterInfo base_reg; // base register number RegisterInfo offset_reg; // offset register kind } RegisterPlusIndirectOffset; struct RegisterToRegisterPlusOffset { RegisterInfo data_reg; // source/target register for data RegisterInfo base_reg; // base register for address calculation int64_t offset; // offset for address calculation } RegisterToRegisterPlusOffset; struct RegisterToRegisterPlusIndirectOffset { RegisterInfo base_reg; // base register for address calculation RegisterInfo offset_reg; // offset register for address calculation RegisterInfo data_reg; // source/target register for data } RegisterToRegisterPlusIndirectOffset; struct RegisterRegisterOperands { RegisterInfo operand1; // register containing first operand for binary op RegisterInfo operand2; // register containing second operand for binary op } RegisterRegisterOperands; int64_t signed_offset; // signed offset by which to adjust self (for // registers only) RegisterInfo reg; // plain register uint64_t unsigned_immediate; // unsigned immediate value int64_t signed_immediate; // signed immediate value lldb::addr_t address; // direct address struct ISAAndImmediate { uint32_t isa; uint32_t unsigned_data32; // immediate data } ISAAndImmediate; struct ISAAndImmediateSigned { uint32_t isa; int32_t signed_data32; // signed immediate data } ISAAndImmediateSigned; uint32_t isa; } info; Context() : type(eContextInvalid), info_type(eInfoTypeNoArgs) {} void SetRegisterPlusOffset(RegisterInfo base_reg, int64_t signed_offset) { info_type = eInfoTypeRegisterPlusOffset; info.RegisterPlusOffset.reg = base_reg; info.RegisterPlusOffset.signed_offset = signed_offset; } void SetRegisterPlusIndirectOffset(RegisterInfo base_reg, RegisterInfo offset_reg) { info_type = eInfoTypeRegisterPlusIndirectOffset; info.RegisterPlusIndirectOffset.base_reg = base_reg; info.RegisterPlusIndirectOffset.offset_reg = offset_reg; } void SetRegisterToRegisterPlusOffset(RegisterInfo data_reg, RegisterInfo base_reg, int64_t offset) { info_type = eInfoTypeRegisterToRegisterPlusOffset; info.RegisterToRegisterPlusOffset.data_reg = data_reg; info.RegisterToRegisterPlusOffset.base_reg = base_reg; info.RegisterToRegisterPlusOffset.offset = offset; } void SetRegisterToRegisterPlusIndirectOffset(RegisterInfo base_reg, RegisterInfo offset_reg, RegisterInfo data_reg) { info_type = eInfoTypeRegisterToRegisterPlusIndirectOffset; info.RegisterToRegisterPlusIndirectOffset.base_reg = base_reg; info.RegisterToRegisterPlusIndirectOffset.offset_reg = offset_reg; info.RegisterToRegisterPlusIndirectOffset.data_reg = data_reg; } void SetRegisterRegisterOperands(RegisterInfo op1_reg, RegisterInfo op2_reg) { info_type = eInfoTypeRegisterRegisterOperands; info.RegisterRegisterOperands.operand1 = op1_reg; info.RegisterRegisterOperands.operand2 = op2_reg; } void SetOffset(int64_t signed_offset) { info_type = eInfoTypeOffset; info.signed_offset = signed_offset; } void SetRegister(RegisterInfo reg) { info_type = eInfoTypeRegister; info.reg = reg; } void SetImmediate(uint64_t immediate) { info_type = eInfoTypeImmediate; info.unsigned_immediate = immediate; } void SetImmediateSigned(int64_t signed_immediate) { info_type = eInfoTypeImmediateSigned; info.signed_immediate = signed_immediate; } void SetAddress(lldb::addr_t address) { info_type = eInfoTypeAddress; info.address = address; } void SetISAAndImmediate(uint32_t isa, uint32_t data) { info_type = eInfoTypeISAAndImmediate; info.ISAAndImmediate.isa = isa; info.ISAAndImmediate.unsigned_data32 = data; } void SetISAAndImmediateSigned(uint32_t isa, int32_t data) { info_type = eInfoTypeISAAndImmediateSigned; info.ISAAndImmediateSigned.isa = isa; info.ISAAndImmediateSigned.signed_data32 = data; } void SetISA(uint32_t isa) { info_type = eInfoTypeISA; info.isa = isa; } void SetNoArgs() { info_type = eInfoTypeNoArgs; } void Dump(Stream &s, EmulateInstruction *instruction) const; }; typedef size_t (*ReadMemoryCallback)(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length); typedef size_t (*WriteMemoryCallback)(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length); typedef bool (*ReadRegisterCallback)(EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value); typedef bool (*WriteRegisterCallback)(EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value); // Type to represent the condition of an instruction. The UINT32 value is // reserved for the // unconditional case and all other value can be used in an architecture // dependent way. typedef uint32_t InstructionCondition; static const InstructionCondition UnconditionalCondition = UINT32_MAX; EmulateInstruction(const ArchSpec &arch); ~EmulateInstruction() override = default; //---------------------------------------------------------------------- // Mandatory overrides //---------------------------------------------------------------------- virtual bool SupportsEmulatingInstructionsOfType(InstructionType inst_type) = 0; virtual bool SetTargetTriple(const ArchSpec &arch) = 0; virtual bool ReadInstruction() = 0; virtual bool EvaluateInstruction(uint32_t evaluate_options) = 0; virtual InstructionCondition GetInstructionCondition() { return UnconditionalCondition; } virtual bool TestEmulation(Stream *out_stream, ArchSpec &arch, OptionValueDictionary *test_data) = 0; virtual bool GetRegisterInfo(lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterInfo &reg_info) = 0; //---------------------------------------------------------------------- // Optional overrides //---------------------------------------------------------------------- virtual bool SetInstruction(const Opcode &insn_opcode, const Address &inst_addr, Target *target); virtual bool CreateFunctionEntryUnwind(UnwindPlan &unwind_plan); static const char *TranslateRegister(lldb::RegisterKind reg_kind, uint32_t reg_num, std::string &reg_name); //---------------------------------------------------------------------- // RegisterInfo variants //---------------------------------------------------------------------- bool ReadRegister(const RegisterInfo *reg_info, RegisterValue &reg_value); uint64_t ReadRegisterUnsigned(const RegisterInfo *reg_info, uint64_t fail_value, bool *success_ptr); bool WriteRegister(const Context &context, const RegisterInfo *ref_info, const RegisterValue &reg_value); bool WriteRegisterUnsigned(const Context &context, const RegisterInfo *reg_info, uint64_t reg_value); //---------------------------------------------------------------------- // Register kind and number variants //---------------------------------------------------------------------- bool ReadRegister(lldb::RegisterKind reg_kind, uint32_t reg_num, RegisterValue &reg_value); bool WriteRegister(const Context &context, lldb::RegisterKind reg_kind, uint32_t reg_num, const RegisterValue &reg_value); uint64_t ReadRegisterUnsigned(lldb::RegisterKind reg_kind, uint32_t reg_num, uint64_t fail_value, bool *success_ptr); bool WriteRegisterUnsigned(const Context &context, lldb::RegisterKind reg_kind, uint32_t reg_num, uint64_t reg_value); size_t ReadMemory(const Context &context, lldb::addr_t addr, void *dst, size_t dst_len); uint64_t ReadMemoryUnsigned(const Context &context, lldb::addr_t addr, size_t byte_size, uint64_t fail_value, bool *success_ptr); bool WriteMemory(const Context &context, lldb::addr_t addr, const void *src, size_t src_len); bool WriteMemoryUnsigned(const Context &context, lldb::addr_t addr, uint64_t uval, size_t uval_byte_size); uint32_t GetAddressByteSize() const { return m_arch.GetAddressByteSize(); } lldb::ByteOrder GetByteOrder() const { return m_arch.GetByteOrder(); } const Opcode &GetOpcode() const { return m_opcode; } lldb::addr_t GetAddress() const { return m_addr; } const ArchSpec &GetArchitecture() const { return m_arch; } static size_t ReadMemoryFrame(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length); static size_t WriteMemoryFrame(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length); static bool ReadRegisterFrame(EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value); static bool WriteRegisterFrame(EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value); static size_t ReadMemoryDefault(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, void *dst, size_t length); static size_t WriteMemoryDefault(EmulateInstruction *instruction, void *baton, const Context &context, lldb::addr_t addr, const void *dst, size_t length); static bool ReadRegisterDefault(EmulateInstruction *instruction, void *baton, const RegisterInfo *reg_info, RegisterValue &reg_value); static bool WriteRegisterDefault(EmulateInstruction *instruction, void *baton, const Context &context, const RegisterInfo *reg_info, const RegisterValue &reg_value); void SetBaton(void *baton); void SetCallbacks(ReadMemoryCallback read_mem_callback, WriteMemoryCallback write_mem_callback, ReadRegisterCallback read_reg_callback, WriteRegisterCallback write_reg_callback); void SetReadMemCallback(ReadMemoryCallback read_mem_callback); void SetWriteMemCallback(WriteMemoryCallback write_mem_callback); void SetReadRegCallback(ReadRegisterCallback read_reg_callback); void SetWriteRegCallback(WriteRegisterCallback write_reg_callback); static bool GetBestRegisterKindAndNumber(const RegisterInfo *reg_info, lldb::RegisterKind &reg_kind, uint32_t &reg_num); static uint32_t GetInternalRegisterNumber(RegisterContext *reg_ctx, const RegisterInfo &reg_info); protected: ArchSpec m_arch; void *m_baton; ReadMemoryCallback m_read_mem_callback; WriteMemoryCallback m_write_mem_callback; ReadRegisterCallback m_read_reg_callback; WriteRegisterCallback m_write_reg_callback; lldb::addr_t m_addr; Opcode m_opcode; private: //------------------------------------------------------------------ // For EmulateInstruction only //------------------------------------------------------------------ DISALLOW_COPY_AND_ASSIGN(EmulateInstruction); }; } // namespace lldb_private #endif // lldb_EmulateInstruction_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Interpreter/Options.h
//===-- Options.h -----------------------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_Options_h_ #define liblldb_Options_h_ // C Includes // C++ Includes #include <set> #include <vector> // Other libraries and framework includes // Project includes #include "lldb/Interpreter/Args.h" #include "lldb/lldb-defines.h" #include "lldb/lldb-private.h" #include "llvm/ADT/ArrayRef.h" namespace lldb_private { static inline bool isprint8(int ch) { if (ch & 0xffffff00u) return false; return isprint(ch); } //---------------------------------------------------------------------- /// @class Options Options.h "lldb/Interpreter/Options.h" /// @brief A command line option parsing protocol class. /// /// Options is designed to be subclassed to contain all needed /// options for a given command. The options can be parsed by calling: /// \code /// Error Args::ParseOptions (Options &); /// \endcode /// /// The options are specified using the format defined for the libc /// options parsing function getopt_long_only: /// \code /// #include <getopt.h> /// int getopt_long_only(int argc, char * const *argv, const char /// *optstring, const struct option *longopts, int *longindex); /// \endcode /// /// Example code: /// \code /// #include <getopt.h> /// #include <string> /// /// class CommandOptions : public Options /// { /// public: /// virtual struct option * /// GetLongOptions() { /// return g_options; /// } /// /// virtual Error /// SetOptionValue (uint32_t option_idx, int option_val, const char /// *option_arg) /// { /// Error error; /// switch (option_val) /// { /// case 'g': debug = true; break; /// case 'v': verbose = true; break; /// case 'l': log_file = option_arg; break; /// case 'f': log_flags = strtoull(option_arg, nullptr, 0); break; /// default: /// error.SetErrorStringWithFormat("unrecognized short option /// %c", option_val); /// break; /// } /// /// return error; /// } /// /// CommandOptions (CommandInterpreter &interpreter) : debug (true), /// verbose (false), log_file (), log_flags (0) /// {} /// /// bool debug; /// bool verbose; /// std::string log_file; /// uint32_t log_flags; /// /// static struct option g_options[]; /// /// }; /// /// struct option CommandOptions::g_options[] = /// { /// { "debug", no_argument, nullptr, 'g' }, /// { "log-file", required_argument, nullptr, 'l' }, /// { "log-flags", required_argument, nullptr, 'f' }, /// { "verbose", no_argument, nullptr, 'v' }, /// { nullptr, 0, nullptr, 0 } /// }; /// /// int main (int argc, const char **argv, const char **envp) /// { /// CommandOptions options; /// Args main_command; /// main_command.SetArguments(argc, argv, false); /// main_command.ParseOptions(options); /// /// if (options.verbose) /// { /// std::cout << "verbose is on" << std::endl; /// } /// } /// \endcode //---------------------------------------------------------------------- class Options { public: Options(); virtual ~Options(); void BuildGetoptTable(); void BuildValidOptionSets(); uint32_t NumCommandOptions(); //------------------------------------------------------------------ /// Get the option definitions to use when parsing Args options. /// /// @see Args::ParseOptions (Options&) /// @see man getopt_long_only //------------------------------------------------------------------ Option *GetLongOptions(); // This gets passed the short option as an integer... void OptionSeen(int short_option); bool VerifyOptions(CommandReturnObject &result); // Verify that the options given are in the options table and can // be used together, but there may be some required options that are // missing (used to verify options that get folded into command aliases). bool VerifyPartialOptions(CommandReturnObject &result); void OutputFormattedUsageText(Stream &strm, const OptionDefinition &option_def, uint32_t output_max_columns); void GenerateOptionUsage(Stream &strm, CommandObject *cmd, uint32_t screen_width); bool SupportsLongOption(const char *long_option); // The following two pure virtual functions must be defined by every // class that inherits from this class. virtual llvm::ArrayRef<OptionDefinition> GetDefinitions() { return llvm::ArrayRef<OptionDefinition>(); } // Call this prior to parsing any options. This call will call the // subclass OptionParsingStarting() and will avoid the need for all // OptionParsingStarting() function instances from having to call the // Option::OptionParsingStarting() like they did before. This was error // prone and subclasses shouldn't have to do it. void NotifyOptionParsingStarting(ExecutionContext *execution_context); Error NotifyOptionParsingFinished(ExecutionContext *execution_context); //------------------------------------------------------------------ /// Set the value of an option. /// /// @param[in] option_idx /// The index into the "struct option" array that was returned /// by Options::GetLongOptions(). /// /// @param[in] option_arg /// The argument value for the option that the user entered, or /// nullptr if there is no argument for the current option. /// /// @param[in] execution_context /// The execution context to use for evaluating the option. /// May be nullptr if the option is to be evaluated outside any /// particular context. /// /// @see Args::ParseOptions (Options&) /// @see man getopt_long_only //------------------------------------------------------------------ virtual Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) = 0; //------------------------------------------------------------------ /// Handles the generic bits of figuring out whether we are in an /// option, and if so completing it. /// /// @param[in] input /// The command line parsed into words /// /// @param[in] cursor_index /// The index in \ainput of the word in which the cursor lies. /// /// @param[in] char_pos /// The character position of the cursor in its argument word. /// /// @param[in] match_start_point /// @param[in] match_return_elements /// See CommandObject::HandleCompletions for a description of /// how these work. /// /// @param[in] interpreter /// The interpreter that's doing the completing. /// /// @param[out] word_complete /// \btrue if this is a complete option value (a space will be /// inserted after the completion.) \b false otherwise. /// /// @param[out] matches /// The array of matches returned. /// /// FIXME: This is the wrong return value, since we also need to /// make a distinction between total number of matches, and the /// window the user wants returned. /// /// @return /// \btrue if we were in an option, \bfalse otherwise. //------------------------------------------------------------------ bool HandleOptionCompletion(Args &input, OptionElementVector &option_map, int cursor_index, int char_pos, int match_start_point, int max_return_elements, CommandInterpreter &interpreter, bool &word_complete, lldb_private::StringList &matches); //------------------------------------------------------------------ /// Handles the generic bits of figuring out whether we are in an /// option, and if so completing it. /// /// @param[in] interpreter /// The command interpreter doing the completion. /// /// @param[in] input /// The command line parsed into words /// /// @param[in] cursor_index /// The index in \ainput of the word in which the cursor lies. /// /// @param[in] char_pos /// The character position of the cursor in its argument word. /// /// @param[in] opt_element_vector /// The results of the options parse of \a input. /// /// @param[in] opt_element_index /// The position in \a opt_element_vector of the word in \a /// input containing the cursor. /// /// @param[in] match_start_point /// @param[in] match_return_elements /// See CommandObject::HandleCompletions for a description of /// how these work. /// /// @param[in] interpreter /// The command interpreter in which we're doing completion. /// /// @param[out] word_complete /// \btrue if this is a complete option value (a space will /// be inserted after the completion.) \bfalse otherwise. /// /// @param[out] matches /// The array of matches returned. /// /// FIXME: This is the wrong return value, since we also need to /// make a distinction between total number of matches, and the /// window the user wants returned. /// /// @return /// \btrue if we were in an option, \bfalse otherwise. //------------------------------------------------------------------ virtual bool HandleOptionArgumentCompletion(Args &input, int cursor_index, int char_pos, OptionElementVector &opt_element_vector, int opt_element_index, int match_start_point, int max_return_elements, CommandInterpreter &interpreter, bool &word_complete, StringList &matches); protected: // This is a set of options expressed as indexes into the options table for // this Option. typedef std::set<int> OptionSet; typedef std::vector<OptionSet> OptionSetVector; std::vector<Option> m_getopt_table; OptionSet m_seen_options; OptionSetVector m_required_options; OptionSetVector m_optional_options; OptionSetVector &GetRequiredOptions() { BuildValidOptionSets(); return m_required_options; } OptionSetVector &GetOptionalOptions() { BuildValidOptionSets(); return m_optional_options; } bool IsASubset(const OptionSet &set_a, const OptionSet &set_b); size_t OptionsSetDiff(const OptionSet &set_a, const OptionSet &set_b, OptionSet &diffs); void OptionsSetUnion(const OptionSet &set_a, const OptionSet &set_b, OptionSet &union_set); // Subclasses must reset their option values prior to starting a new // option parse. Each subclass must override this function and revert // all option settings to default values. virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0; virtual Error OptionParsingFinished(ExecutionContext *execution_context) { // If subclasses need to know when the options are done being parsed // they can implement this function to do extra checking Error error; return error; } }; class OptionGroup { public: OptionGroup() = default; virtual ~OptionGroup() = default; virtual llvm::ArrayRef<OptionDefinition> GetDefinitions() = 0; virtual Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_value, ExecutionContext *execution_context) = 0; virtual void OptionParsingStarting(ExecutionContext *execution_context) = 0; virtual Error OptionParsingFinished(ExecutionContext *execution_context) { // If subclasses need to know when the options are done being parsed // they can implement this function to do extra checking Error error; return error; } }; class OptionGroupOptions : public Options { public: OptionGroupOptions() : Options(), m_option_defs(), m_option_infos(), m_did_finalize(false) {} ~OptionGroupOptions() override = default; //---------------------------------------------------------------------- /// Append options from a OptionGroup class. /// /// Append all options from \a group using the exact same option groups /// that each option is defined with. /// /// @param[in] group /// A group of options to take option values from and copy their /// definitions into this class. //---------------------------------------------------------------------- void Append(OptionGroup *group); //---------------------------------------------------------------------- /// Append options from a OptionGroup class. /// /// Append options from \a group that have a usage mask that has any bits /// in "src_mask" set. After the option definition is copied into the /// options definitions in this class, set the usage_mask to "dst_mask". /// /// @param[in] group /// A group of options to take option values from and copy their /// definitions into this class. /// /// @param[in] src_mask /// When copying options from \a group, you might only want some of /// the options to be appended to this group. This mask allows you /// to control which options from \a group get added. It also allows /// you to specify the same options from \a group multiple times /// for different option sets. /// /// @param[in] dst_mask /// Set the usage mask for any copied options to \a dst_mask after /// copying the option definition. //---------------------------------------------------------------------- void Append(OptionGroup *group, uint32_t src_mask, uint32_t dst_mask); void Finalize(); bool DidFinalize() { return m_did_finalize; } Error SetOptionValue(uint32_t option_idx, llvm::StringRef option_arg, ExecutionContext *execution_context) override; void OptionParsingStarting(ExecutionContext *execution_context) override; Error OptionParsingFinished(ExecutionContext *execution_context) override; llvm::ArrayRef<OptionDefinition> GetDefinitions() override { assert(m_did_finalize); return m_option_defs; } const OptionGroup *GetGroupWithOption(char short_opt); struct OptionInfo { OptionInfo(OptionGroup *g, uint32_t i) : option_group(g), option_index(i) {} OptionGroup *option_group; // The group that this option came from uint32_t option_index; // The original option index from the OptionGroup }; typedef std::vector<OptionInfo> OptionInfos; std::vector<OptionDefinition> m_option_defs; OptionInfos m_option_infos; bool m_did_finalize; }; } // namespace lldb_private #endif // liblldb_Options_h_
Polidea/SiriusObfuscator
SymbolExtractorAndRenamer/lldb/include/lldb/Breakpoint/BreakpointResolverName.h
//===-- BreakpointResolverName.h --------------------------------*- C++ -*-===// // // The LLVM Compiler Infrastructure // // This file is distributed under the University of Illinois Open Source // License. See LICENSE.TXT for details. // //===----------------------------------------------------------------------===// #ifndef liblldb_BreakpointResolverName_h_ #define liblldb_BreakpointResolverName_h_ // C Includes // C++ Includes #include <string> #include <vector> // Other libraries and framework includes // Project includes #include "lldb/Breakpoint/BreakpointResolver.h" #include "lldb/Core/Module.h" namespace lldb_private { //---------------------------------------------------------------------- /// @class BreakpointResolverName BreakpointResolverName.h /// "lldb/Breakpoint/BreakpointResolverName.h" /// @brief This class sets breakpoints on a given function name, either by exact /// match /// or by regular expression. //---------------------------------------------------------------------- class BreakpointResolverName : public BreakpointResolver { public: BreakpointResolverName(Breakpoint *bkpt, const char *name, uint32_t name_type_mask, lldb::LanguageType language, Breakpoint::MatchType type, lldb::addr_t offset, bool skip_prologue); // This one takes an array of names. It is always MatchType = Exact. BreakpointResolverName(Breakpoint *bkpt, const char *names[], size_t num_names, uint32_t name_type_mask, lldb::LanguageType language, lldb::addr_t offset, bool skip_prologue); // This one takes a C++ array of names. It is always MatchType = Exact. BreakpointResolverName(Breakpoint *bkpt, std::vector<std::string> names, uint32_t name_type_mask, lldb::LanguageType language, lldb::addr_t offset, bool skip_prologue); // Creates a function breakpoint by regular expression. Takes over control of // the lifespan of func_regex. BreakpointResolverName(Breakpoint *bkpt, RegularExpression &func_regex, lldb::LanguageType language, lldb::addr_t offset, bool skip_prologue); static BreakpointResolver * CreateFromStructuredData(Breakpoint *bkpt, const StructuredData::Dictionary &data_dict, Error &error); StructuredData::ObjectSP SerializeToStructuredData() override; ~BreakpointResolverName() override; Searcher::CallbackReturn SearchCallback(SearchFilter &filter, SymbolContext &context, Address *addr, bool containing) override; Searcher::Depth GetDepth() override; void GetDescription(Stream *s) override; void Dump(Stream *s) const override; /// Methods for support type inquiry through isa, cast, and dyn_cast: static inline bool classof(const BreakpointResolverName *) { return true; } static inline bool classof(const BreakpointResolver *V) { return V->getResolverID() == BreakpointResolver::NameResolver; } lldb::BreakpointResolverSP CopyForBreakpoint(Breakpoint &breakpoint) override; protected: BreakpointResolverName(const BreakpointResolverName &rhs); std::vector<Module::LookupInfo> m_lookups; ConstString m_class_name; RegularExpression m_regex; Breakpoint::MatchType m_match_type; lldb::LanguageType m_language; bool m_skip_prologue; void AddNameLookup(const ConstString &name, uint32_t name_type_mask); }; } // namespace lldb_private #endif // liblldb_BreakpointResolverName_h_