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
191 changes: 0 additions & 191 deletions okio-wasifilesystem/api/okio-wasifilesystem.klib.api

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import okio.IOException
import okio.internal.preview1.Errno
import okio.internal.preview1.errno

class ErrnoException(
internal class ErrnoException(
val errno: Errno,
) : IOException(errno.name) {
constructor(errno: errno) : this(Errno.entries[errno.toInt()])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
package okio.internal.preview1

@Suppress("ktlint:enum-entry-name-case")
enum class Errno {
internal enum class Errno {
/** `success`: No error occurred. System call completed successfully. */
success,

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ package okio.internal.preview1
*
* File descriptor flags.
*/
typealias fdflags = Short
internal typealias fdflags = Short

/** Data written to the file is always appended to the file's end. */
val fdflags_append: Short = (1 shl 0).toShort()
internal val fdflags_append: Short = (1 shl 0).toShort()

/** Write according to synchronized I/O data integrity completion. Only the data stored in the file is synchronized. */
val fdflags_dsync: Short = (1 shl 1).toShort()
internal val fdflags_dsync: Short = (1 shl 1).toShort()

/** Non-blocking mode. */
val fdflags_nonblock: Short = (1 shl 2).toShort()
internal val fdflags_nonblock: Short = (1 shl 2).toShort()

/** Synchronized read I/O operations. */
val fdflags_rsync: Short = (1 shl 3).toShort()
internal val fdflags_rsync: Short = (1 shl 3).toShort()

/** Write according to synchronized I/O file integrity completion. In addition to synchronizing the data stored in the file, the implementation may also synchronously update the file's metadata. */
val fdflags_sync: Short = (1 shl 4).toShort()
internal val fdflags_sync: Short = (1 shl 4).toShort()
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,28 @@ package okio.internal.preview1
*
* The type of a file descriptor or file.
*/
typealias filetype = Byte
internal typealias filetype = Byte

/** The type of the file descriptor or file is unknown or is different from any of the other types specified. */
val filetype_unknown: filetype = 0
internal val filetype_unknown: filetype = 0

/** The file descriptor or file refers to a block device inode. */
val filetype_block_device: filetype = 1
internal val filetype_block_device: filetype = 1

/** The file descriptor or file refers to a character device inode. */
val filetype_character_device: filetype = 2
internal val filetype_character_device: filetype = 2

/** The file descriptor or file refers to a directory inode. */
val filetype_directory: filetype = 3
internal val filetype_directory: filetype = 3

/** The file descriptor or file refers to a regular file inode. */
val filetype_regular_file: filetype = 4
internal val filetype_regular_file: filetype = 4

/** The file descriptor or file refers to a datagram socket. */
val filetype_socket_dgram: filetype = 5
internal val filetype_socket_dgram: filetype = 5

/** The file descriptor or file refers to a byte-stream socket. */
val filetype_socket_stream: filetype = 6
internal val filetype_socket_stream: filetype = 6

/** The file refers to a symbolic link inode. */
val filetype_symbolic_link: filetype = 7
internal val filetype_symbolic_link: filetype = 7
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package okio.internal.preview1
* Bit0:
* symlink_follow:
*/
typealias lookupflags = Int
internal typealias lookupflags = Int

/** As long as the resolved path corresponds to a symbolic link, it is expanded. */
val lookupflags_symlink_follow = 1 shl 0
internal val lookupflags_symlink_follow = 1 shl 0
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ package okio.internal.preview1
*
* Open flags used by path_open.
*/
typealias oflags = Int
internal typealias oflags = Int

/** Create file if it does not exist. */
val oflag_creat = 1 shl 0
internal val oflag_creat = 1 shl 0

/** Fail if not a directory. */
val oflag_directory = 1 shl 1
internal val oflag_directory = 1 shl 1

/** Fail if file already exists. */
val oflag_excl = 1 shl 2
internal val oflag_excl = 1 shl 2

/** Truncate file to size 0. */
val oflag_trunc = 1 shl 3
internal val oflag_trunc = 1 shl 3
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@
package okio.internal.preview1

/** `u32`. */
typealias size = Int
internal typealias size = Int

/**
* `Handle`.
*
* A file descriptor handle.
*/
typealias fd = Int
internal typealias fd = Int

/**
* `u64`.
Expand All @@ -20,7 +20,7 @@ typealias fd = Int
*
* The value 0 signifies the start of the directory.
*/
typealias dircookie = Long
internal typealias dircookie = Long

/**
* `Variant`.
Expand All @@ -29,26 +29,26 @@ typealias dircookie = Long
* provided by this API; some are used in higher-level library layers, and others are provided
* merely for alignment with POSIX.
*/
typealias errno = Short
internal typealias errno = Short

/**
* `u64`.
*
* File serial number that is unique within its file system.
*/
typealias inode = Long
internal typealias inode = Long

/**
* `u32`.
*
* The type for the [`dirent::d_namlen`](#dirent.d_namlen) field of [`dirent`](#dirent) struct.
*/
typealias dirnamelen = Int
internal typealias dirnamelen = Int

/**
* `Pointer<u8>`.
*/
typealias PointerU8 = Int
internal typealias PointerU8 = Int

/**
* path_create_directory(fd: fd, path: string) -> Result<(), errno>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,86 +4,86 @@
package okio.internal.preview1

/** `rights: Record`. */
typealias rights = Long
internal typealias rights = Long

/**
* The right to invoke [`fd_datasync`](#fd_datasync)0
* If [`path_open`](#path_open) is set, includes the right to invoke
* [`path_open`](#path_open) with [`fdflags::dsync`](#fdflags.dsync).
*/
val right_fd_datasync = 1L shl 0
internal val right_fd_datasync = 1L shl 0

/**
* The right to invoke [`fd_read`](#fd_read) and [`sock_recv`](#sock_recv).
* If [`rights::fd_seek`](#rights.fd_seek) is set, includes the right to invoke [`fd_pread`](#fd_pread).
*/
val right_fd_read = 1L shl 1
internal val right_fd_read = 1L shl 1

/** The right to invoke [`fd_seek`](#fd_seek). This flag implies [`rights::fd_tell`](#rights.fd_tell). */
val right_fd_seek = 1L shl 2
internal val right_fd_seek = 1L shl 2

/** The right to invoke [`fd_fdstat_set_flags`](#fd_fdstat_set_flags). */
val right_fd_fdstat_set_flags = 1L shl 3
internal val right_fd_fdstat_set_flags = 1L shl 3

/**
* The right to invoke [`fd_sync`](#fd_sync).
* If [`path_open`](#path_open) is set, includes the right to invoke
* [`path_open`](#path_open) with [`fdflags::rsync`](#fdflags.rsync) and [`fdflags::dsync`](#fdflags.dsync).
*/
val right_fd_sync = 1L shl 4
internal val right_fd_sync = 1L shl 4

/**
* The right to invoke [`fd_seek`](#fd_seek) in such a way that the file offset
* remains unaltered (i.e., [`whence::cur`](#whence.cur) with offset zero), or to
* invoke [`fd_tell`](#fd_tell).
*/
val right_fd_tell = 1L shl 5
internal val right_fd_tell = 1L shl 5

/**
* The right to invoke [`fd_write`](#fd_write) and [`sock_send`](#sock_send).
* If [`rights::fd_seek`](#rights.fd_seek) is set, includes the right to invoke [`fd_pwrite`](#fd_pwrite).
*/
val right_fd_write = 1L shl 6
internal val right_fd_write = 1L shl 6

/** The right to invoke [`fd_advise`](#fd_advise). */
val right_fd_advise = 1L shl 7
internal val right_fd_advise = 1L shl 7

/** The right to invoke [`fd_allocate`](#fd_allocate). */
val right_fd_allocate = 1L shl 8
internal val right_fd_allocate = 1L shl 8

/** The right to invoke [`path_create_directory`](#path_create_directory). */
val right_path_create_directory = 1L shl 9
internal val right_path_create_directory = 1L shl 9

/** If [`path_open`](#path_open) is set, the right to invoke [`path_open`](#path_open) with [`oflags::creat`](#oflags.creat). */
val right_path_create_file = 1L shl 10
internal val right_path_create_file = 1L shl 10

/**
* The right to invoke [`path_link`](#path_link) with the file descriptor as the
* source directory.
*/
val right_path_link_source = 1L shl 11
internal val right_path_link_source = 1L shl 11

/** The right to invoke [`path_link`](#path_link) with the file descriptor as the target directory.
*/
val right_path_link_target = 1L shl 12
internal val right_path_link_target = 1L shl 12

/** The right to invoke [`path_open`](#path_open). */
val right_path_open = 1L shl 13
internal val right_path_open = 1L shl 13

/** The right to invoke [`fd_readdir`](#fd_readdir). */
val right_fd_readdir = 1L shl 14
internal val right_fd_readdir = 1L shl 14

/** The right to invoke [`path_readlink`](#path_readlink). */
val right_path_readlink = 1L shl 15
internal val right_path_readlink = 1L shl 15

/** The right to invoke [`path_rename`](#path_rename) with the file descriptor as the source directory. */
val right_path_rename_source = 1L shl 16
internal val right_path_rename_source = 1L shl 16

/** The right to invoke [`path_rename`](#path_rename) with the file descriptor as the target directory. */
val right_path_rename_target = 1L shl 17
internal val right_path_rename_target = 1L shl 17

/** The right to invoke [`path_filestat_get`](#path_filestat_get). */
val right_path_filestat_get = 1L shl 18
internal val right_path_filestat_get = 1L shl 18

/**
* The right to change a file's size.
Expand All @@ -94,37 +94,37 @@ val right_path_filestat_get = 1L shl 18
* no use cases for it since no code written for POSIX systems would use it.
* Moreover, implementing it would require multiple syscalls, leading to inferior performance.
*/
val right_path_filestat_set_size = 1L shl 19
internal val right_path_filestat_set_size = 1L shl 19

/** The right to invoke [`path_filestat_set_times`](#path_filestat_set_times). */
val right_path_filestat_set_times = 1L shl 20
internal val right_path_filestat_set_times = 1L shl 20

/** The right to invoke [`fd_filestat_get`](#fd_filestat_get). */
val right_fd_filestat_get = 1L shl 21
internal val right_fd_filestat_get = 1L shl 21

/** The right to invoke [`fd_filestat_set_size`](#fd_filestat_set_size). */
val right_fd_filestat_set_size = 1L shl 22
internal val right_fd_filestat_set_size = 1L shl 22

/** The right to invoke [`fd_filestat_set_times`](#fd_filestat_set_times). */
val right_fd_filestat_set_times = 1L shl 23
internal val right_fd_filestat_set_times = 1L shl 23

/** The right to invoke [`path_symlink`](#path_symlink). */
val right_path_symlink = 1L shl 24
internal val right_path_symlink = 1L shl 24

/** The right to invoke [`path_remove_directory`](#path_remove_directory). */
val right_path_remove_directory = 1L shl 25
internal val right_path_remove_directory = 1L shl 25

/** The right to invoke [`path_unlink_file`](#path_unlink_file). */
val right_path_unlink_file = 1L shl 26
internal val right_path_unlink_file = 1L shl 26

/**
* If [`rights::fd_read`](#rights.fd_read) is set, includes the right to invoke [`poll_oneoff`](#poll_oneoff) to subscribe to [`eventtype::fd_read`](#eventtype.fd_read).
* If [`rights::fd_write`](#rights.fd_write) is set, includes the right to invoke [`poll_oneoff`](#poll_oneoff) to subscribe to [`eventtype::fd_write`](#eventtype.fd_write).
*/
val right_poll_fd_readwrite = 1L shl 27
internal val right_poll_fd_readwrite = 1L shl 27

/** The right to invoke [`sock_shutdown`](#sock_shutdown). */
val right_sock_shutdown = 1L shl 28
internal val right_sock_shutdown = 1L shl 28

/** The right to invoke [`sock_accept`](#sock_accept). */
val right_sock_accept = 1L shl 29
internal val right_sock_accept = 1L shl 29
6 changes: 0 additions & 6 deletions okio/api/okio.api
Original file line number Diff line number Diff line change
Expand Up @@ -860,9 +860,3 @@ public final class okio/_JvmPlatformKt {
public static final fun withLock (Ljava/util/concurrent/locks/ReentrantLock;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
}

public final class okio/internal/_Utf8Kt {
public static final fun commonAsUtf8ToByteArray (Ljava/lang/String;)[B
public static final fun commonToUtf8String ([BII)Ljava/lang/String;
public static synthetic fun commonToUtf8String$default ([BIIILjava/lang/Object;)Ljava/lang/String;
}

12 changes: 0 additions & 12 deletions okio/api/okio.klib.api
Original file line number Diff line number Diff line change
Expand Up @@ -569,8 +569,6 @@ open class okio/Timeout { // okio/Timeout|null[0]
}
}

final fun (kotlin/ByteArray).okio.internal/commonToUtf8String(kotlin/Int = ..., kotlin/Int = ...): kotlin/String // okio.internal/commonToUtf8String|commonToUtf8String@kotlin.ByteArray(kotlin.Int;kotlin.Int){}[0]
final fun (kotlin/String).okio.internal/commonAsUtf8ToByteArray(): kotlin/ByteArray // okio.internal/commonAsUtf8ToByteArray|commonAsUtf8ToByteArray@kotlin.String(){}[0]
final fun (kotlin/String).okio/utf8Size(kotlin/Int = ..., kotlin/Int = ...): kotlin/Long // okio/utf8Size|utf8Size@kotlin.String(kotlin.Int;kotlin.Int){}[0]
final fun (okio/Sink).okio/buffer(): okio/BufferedSink // okio/buffer|buffer@okio.Sink(){}[0]
final fun (okio/Source).okio/buffer(): okio/BufferedSource // okio/buffer|buffer@okio.Source(){}[0]
Expand All @@ -593,16 +591,6 @@ final inline fun <#A: okio/BufferedSink> (#A).okio/writeUShort(kotlin/UShort): #
final inline fun <#A: okio/BufferedSink> (#A).okio/writeUShortLe(kotlin/UShort): #A // okio/writeUShortLe|writeUShortLe@0:0(kotlin.UShort){0§<okio.BufferedSink>}[0]
final inline fun <#A: okio/Closeable?, #B: kotlin/Any?> (#A).okio/use(kotlin/Function1<#A, #B>): #B // okio/use|use@0:0(kotlin.Function1<0:0,0:1>){0§<okio.Closeable?>;1§<kotlin.Any?>}[0]

// Targets: [native]
final class okio.internal/CRC32 { // okio.internal/CRC32|null[0]
constructor <init>() // okio.internal/CRC32.<init>|<init>(){}[0]

final fun getValue(): kotlin/Long // okio.internal/CRC32.getValue|getValue(){}[0]
final fun reset() // okio.internal/CRC32.reset|reset(){}[0]
final fun update(kotlin/ByteArray) // okio.internal/CRC32.update|update(kotlin.ByteArray){}[0]
final fun update(kotlin/ByteArray, kotlin/Int, kotlin/Int) // okio.internal/CRC32.update|update(kotlin.ByteArray;kotlin.Int;kotlin.Int){}[0]
}

// Targets: [native]
final class okio/Deflater { // okio/Deflater|null[0]
constructor <init>() // okio/Deflater.<init>|<init>(){}[0]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@file:Suppress(
"CANNOT_OVERRIDE_INVISIBLE_MEMBER",
"INVISIBLE_MEMBER",
"INVISIBLE_REFERENCE",
)

package com.squareup.okio.benchmarks

import okio.internal.commonAsUtf8ToByteArray
Expand Down
4 changes: 2 additions & 2 deletions okio/src/commonMain/kotlin/okio/internal/-Utf8.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import okio.processUtf8Bytes
// to everything else. Putting them in this file, `-Utf8.kt`, makes them invisible to
// Java but still visible to Kotlin.

fun ByteArray.commonToUtf8String(beginIndex: Int = 0, endIndex: Int = size): String {
internal fun ByteArray.commonToUtf8String(beginIndex: Int = 0, endIndex: Int = size): String {
if (beginIndex < 0 || endIndex > size || beginIndex > endIndex) {
throw ArrayIndexOutOfBoundsException("size=$size beginIndex=$beginIndex endIndex=$endIndex")
}
Expand All @@ -38,7 +38,7 @@ fun ByteArray.commonToUtf8String(beginIndex: Int = 0, endIndex: Int = size): Str
return chars.concatToString(0, length)
}

fun String.commonAsUtf8ToByteArray(): ByteArray {
internal fun String.commonAsUtf8ToByteArray(): ByteArray {
val bytes = ByteArray(4 * length)

// Assume ASCII until a UTF-8 code point is observed. This is ugly but yields
Expand Down
Loading
Loading