Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/MachOKit/Header/CPU.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct CPU: Equatable {
public struct CPU: Sendable, Equatable {
public let typeRawValue: cpu_type_t
public let subtypeRawValue: cpu_subtype_t

Expand Down
32 changes: 16 additions & 16 deletions Sources/MachOKit/Header/CPUSubType.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Foundation

public enum CPUSubType: Equatable {
public enum CPUSubType: Sendable, Equatable {
case any(CPUAnySubType)
case vax(CPUVAXSubType)
case mc680x0(CPUMC680x0SubType)
Expand Down Expand Up @@ -179,7 +179,7 @@ extension CPUSubType: CustomStringConvertible {
}

// MARK: - Any
public enum CPUAnySubType: Equatable {
public enum CPUAnySubType: Sendable, Equatable {
/// CPU_SUBTYPE_MULTIPLE
case multiple
/// CPU_SUBTYPE_LITTLE_ENDIAN
Expand Down Expand Up @@ -221,7 +221,7 @@ extension CPUAnySubType: CustomStringConvertible {
}

// MARK: - VAX
public enum CPUVAXSubType: Equatable {
public enum CPUVAXSubType: Sendable, Equatable {
/// CPU_SUBTYPE_VAX_ALL
case vax_all
/// CPU_SUBTYPE_VAX780
Expand Down Expand Up @@ -313,7 +313,7 @@ extension CPUVAXSubType: CustomStringConvertible {
}

// MARK: - MC680x0
public enum CPUMC680x0SubType: Equatable {
public enum CPUMC680x0SubType: Sendable, Equatable {
/// CPU_SUBTYPE_MC680x0_ALL
case mc680x0_all
/// CPU_SUBTYPE_MC68030
Expand Down Expand Up @@ -360,7 +360,7 @@ extension CPUMC680x0SubType: CustomStringConvertible {
}

// MARK: - I386
public enum CPUI386SubType: Equatable {
public enum CPUI386SubType: Sendable, Equatable {
/// CPU_SUBTYPE_I386_ALL
case i386_all
/// CPU_SUBTYPE_386
Expand Down Expand Up @@ -497,7 +497,7 @@ extension CPUI386SubType: CustomStringConvertible {
}

// MARK: - X86
public enum CPUX86SubType: Equatable {
public enum CPUX86SubType: Sendable, Equatable {
/// CPU_SUBTYPE_X86_ALL
case x86_all
/// CPU_SUBTYPE_X86_64_ALL
Expand Down Expand Up @@ -544,7 +544,7 @@ extension CPUX86SubType: CustomStringConvertible {
}

// MARK: - Mips
public enum CPUMipsSubType: Equatable {
public enum CPUMipsSubType: Sendable, Equatable {
/// CPU_SUBTYPE_MIPS_ALL
case mips_all
/// CPU_SUBTYPE_MIPS_R2300
Expand Down Expand Up @@ -611,7 +611,7 @@ extension CPUMipsSubType: CustomStringConvertible {
}

// MARK: - MC98000
public enum CPUMC98000SubType: Equatable {
public enum CPUMC98000SubType: Sendable, Equatable {
/// CPU_SUBTYPE_MC98000_ALL
case mc98000_all
/// CPU_SUBTYPE_MC98601
Expand Down Expand Up @@ -648,7 +648,7 @@ extension CPUMC98000SubType: CustomStringConvertible {
}

// MARK: - HPPA
public enum CPUHPPASubType: Equatable {
public enum CPUHPPASubType: Sendable, Equatable {
/// CPU_SUBTYPE_HPPA_ALL
case hppa_all
/// CPU_SUBTYPE_HPPA_7100
Expand Down Expand Up @@ -690,7 +690,7 @@ extension CPUHPPASubType: CustomStringConvertible {
}

// MARK: - MC88000
public enum CPUMC88000SubType: Equatable {
public enum CPUMC88000SubType: Sendable, Equatable {
/// CPU_SUBTYPE_MC88000_ALL
case mc88000_all
/// CPU_SUBTYPE_MC88100
Expand Down Expand Up @@ -732,7 +732,7 @@ extension CPUMC88000SubType: CustomStringConvertible {
}

// MARK: - SPARC
public enum CPUSPARCSubType: Equatable {
public enum CPUSPARCSubType: Sendable, Equatable {
/// CPU_SUBTYPE_SPARC_ALL
case sparc_all
}
Expand Down Expand Up @@ -764,7 +764,7 @@ extension CPUSPARCSubType: CustomStringConvertible {
}

// MARK: - I860
public enum CPUI860SubType: Equatable {
public enum CPUI860SubType: Sendable, Equatable {
/// CPU_SUBTYPE_I860_ALL
case i860_all
/// CPU_SUBTYPE_I860_860
Expand Down Expand Up @@ -801,7 +801,7 @@ extension CPUI860SubType: CustomStringConvertible {
}

// MARK: - PowerPC
public enum CPUPowerPCSubType: Equatable {
public enum CPUPowerPCSubType: Sendable, Equatable {
/// CPU_SUBTYPE_POWERPC_ALL
case powerpc_all
/// CPU_SUBTYPE_POWERPC_601
Expand Down Expand Up @@ -893,7 +893,7 @@ extension CPUPowerPCSubType: CustomStringConvertible {
}

// MARK: - ARM
public enum CPUARMSubType: Equatable {
public enum CPUARMSubType: Sendable, Equatable {
/// CPU_SUBTYPE_ARM_ALL
case arm_all
/// CPU_SUBTYPE_ARM_V4T
Expand Down Expand Up @@ -990,7 +990,7 @@ extension CPUARMSubType: CustomStringConvertible {
}

// MARK: - ARM64
public enum CPUARM64SubType: Equatable {
public enum CPUARM64SubType: Sendable, Equatable {
/// CPU_SUBTYPE_ARM64_ALL
case arm64_all
/// CPU_SUBTYPE_ARM64_V8
Expand Down Expand Up @@ -1032,7 +1032,7 @@ extension CPUARM64SubType: CustomStringConvertible {
}

// MARK: - ARM64_32
public enum CPUARM64_32SubType: Equatable {
public enum CPUARM64_32SubType: Sendable, Equatable {
/// CPU_SUBTYPE_ARM64_32_ALL
case arm64_32_all
/// CPU_SUBTYPE_ARM64_32_V8
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/Header/CPUType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum CPUType: Equatable, CaseIterable {
public enum CPUType: Sendable, Equatable, CaseIterable {
/// CPU_TYPE_ANY
case any
/// CPU_TYPE_VAX
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct DyldCacheHeader: LayoutWrapper {
public struct DyldCacheHeader: LayoutWrapper, Sendable {
public typealias Layout = dyld_cache_header

public var layout: Layout
Expand Down
4 changes: 2 additions & 2 deletions Sources/MachOKit/Header/DyldCacheHeader/DyldCacheType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@

import Foundation

public enum DyldCacheType: UInt64 {
public enum DyldCacheType: UInt64, Sendable {
case development
case production
case multiCache
}

public enum DyldCacheSubType: UInt32 {
public enum DyldCacheSubType: UInt32, Sendable {
case development
case production
}
2 changes: 1 addition & 1 deletion Sources/MachOKit/Header/FatHeader/FatArch.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct FatArch: LayoutWrapper {
public struct FatArch: LayoutWrapper, Sendable {
public var layout: fat_arch

public var cpuType: CPUType? {
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/Header/FatHeader/FatHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct FatHeader: LayoutWrapper {
public struct FatHeader: LayoutWrapper, Sendable {
public var layout: fat_header

public var magic: Magic! {
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/Header/MachHeader/FileType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum FileType {
public enum FileType: Sendable {
/// MH_OBJECT
case object
/// MH_EXECUTE
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import Foundation

extension MachHeader.Flags {
public enum Bit: CaseIterable {
public enum Bit: Sendable, CaseIterable {
/// MH_NOUNDEFS
case noundefs
/// MH_INCRLINK
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/Header/MachHeader/MachHeader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct MachHeader: LayoutWrapper {
public struct MachHeader: LayoutWrapper, Sendable {
public var layout: mach_header

public var magic: Magic! {
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/Header/Magic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum Magic: CaseIterable, Codable, Equatable {
public enum Magic: CaseIterable, Sendable, Codable, Equatable {
/// MH_MAGIC
case magic
/// MH_CIGAM
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/LoadCommand.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum LoadCommand {
public enum LoadCommand: Sendable {
/// LC_SEGMENT
case segment(SegmentCommand)
/// LC_SYMTAB
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/LoadCommandInfo.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct LoadCommandInfo<Layout>: LoadCommandWrapper {
public struct LoadCommandInfo<Layout: Sendable>: LoadCommandWrapper {
public var layout: Layout
public var offset: Int // offset from mach header trailing

Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/LoadCommandType.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum LoadCommandType {
public enum LoadCommandType: Sendable {
/// LC_SEGMENT
case segment
/// LC_SYMTAB
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/Model/BuildToolVersion.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct BuildToolVersion: LayoutWrapper {
public struct BuildToolVersion: LayoutWrapper, Sendable {
public var layout: build_tool_version

public var tool: Tool? {
Expand Down
4 changes: 2 additions & 2 deletions Sources/MachOKit/LoadCommand/Model/Dylib.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
//
//
// Created by p-x9 on 2023/11/29.
//
//
//

import Foundation

public struct Dylib {
public struct Dylib: Sendable {
/// library's path name
public var name: String

Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/Model/DylibUseFlags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension DylibUseFlags {
}

extension DylibUseFlags {
public enum Bit: CaseIterable {
public enum Bit: Sendable, CaseIterable {
/// DYLIB_USE_WEAK_LINK
case weak_link
/// DYLIB_USE_REEXPORT
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/Model/Platform.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum Platform {
public enum Platform: Sendable {
/// PLATFORM_UNKNOWN
case unknown
/// PLATFORM_ANY
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/Model/Section+Attribute.swift
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ extension SectionAttributes {
}

extension SectionAttributes {
public enum Bit: CaseIterable {
public enum Bit: Sendable, CaseIterable {
/// S_ATTR_PURE_INSTRUCTIONS
case pure_instructions
/// S_ATTR_NO_TOC
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/Model/Section+Flags.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public struct SectionFlags {
public struct SectionFlags: Sendable {
public let rawValue: UInt32

public var type: SectionType? {
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/Model/Section+Type.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public enum SectionType {
public enum SectionType: Sendable {
/// S_REGULAR
case regular
/// S_ZEROFILL
Expand Down
2 changes: 1 addition & 1 deletion Sources/MachOKit/LoadCommand/Model/Section.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

import Foundation

public protocol SectionProtocol: LayoutWrapper {
public protocol SectionProtocol: LayoutWrapper, Sendable {
/// Name of this section
var sectionName: String { get }
// Segment name this section goes in
Expand Down
10 changes: 5 additions & 5 deletions Sources/MachOKit/LoadCommand/Model/ThreadState.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,32 +9,32 @@
import Foundation
import MachOKitC

public enum ThreadState {
public enum ThreadState: Sendable {
case arm(ARMThreadState)
case arm64(ARM64ThreadState)
case i386(i386ThreadState)
case x86_64(x86_64ThreadState)
}

public struct x86_64ThreadState: LayoutWrapper {
public struct x86_64ThreadState: LayoutWrapper, Sendable {
public typealias Layout = x86_thread_state64

public var layout: Layout
}

public struct i386ThreadState: LayoutWrapper {
public struct i386ThreadState: LayoutWrapper, Sendable {
public typealias Layout = i386_thread_state

public var layout: Layout
}

public struct ARMThreadState: LayoutWrapper {
public struct ARMThreadState: LayoutWrapper, Sendable {
public typealias Layout = arm_thread_state

public var layout: Layout
}

public struct ARM64ThreadState: LayoutWrapper {
public struct ARM64ThreadState: LayoutWrapper, Sendable {
public typealias Layout = arm_thread_state64

public var layout: Layout
Expand Down
Loading