Skip to content

Commit

Permalink
Add PackageDescription
Browse files Browse the repository at this point in the history
  • Loading branch information
Arror committed Apr 19, 2022
1 parent 5ebdc9f commit 7a51119
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
14 changes: 14 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
// swift-tools-version:5.5

import PackageDescription

let package = Package(
name: "T2SKit",
products: [
.library(name: "T2SKit", targets: ["T2SKit", "Tun2SocksFramework"])
],
targets: [
.target(name: "T2SKit"),
.binaryTarget(name: "Tun2SocksFramework", url: "", checksum: "")
]
)
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
# Tun2SocksKit
# T2SKit

A description of this package.
16 changes: 16 additions & 0 deletions Sources/T2SKit/T2SKit.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Foundation

@_silgen_name("startTun2Socks") private func rust_startTun2Socks(_ config: UnsafePointer<CChar>!) -> Int32

@_silgen_name("stopTun2Socks") private func rust_stopTun2Socks() -> Bool

public enum Tun2Socks {

public static func start(config: String) -> Int32 {
rust_startTun2Socks(config.cString(using: .utf8))
}

public static func stop() -> Bool {
rust_stopTun2Socks()
}
}

0 comments on commit 7a51119

Please sign in to comment.