| // ignore_for_file: type=lint, unused_field |
| |
| // AUTO GENERATED FILE, DO NOT EDIT. |
| // |
| // Generated by `package:ffigen`. |
| @ffi.DefaultAsset('package:unix_api/libc_shim') |
| library; |
| |
| import 'dart:ffi' as ffi; |
| |
| /// Returns `libc_shim_dirent.d_name`. |
| /// |
| /// TODO(brianquinlan): Remove `libc_shim_d_name_ptr` when there is a fix for: |
| /// https://github.com/dart-lang/sdk/issues/41237 |
| @ffi.Native<ffi.Pointer<ffi.Char> Function(ffi.Pointer<dirent>)>() |
| external ffi.Pointer<ffi.Char> libc_shim_d_name_ptr(ffi.Pointer<dirent> d); |
| |
| @ffi.Native<ffi.Int Function(ffi.Pointer<DIR>, ffi.Pointer<ffi.Int>)>() |
| external int libc_shim_closedir(ffi.Pointer<DIR> d, ffi.Pointer<ffi.Int> err); |
| |
| @ffi.Native<ffi.Pointer<DIR> Function(ffi.Int, ffi.Pointer<ffi.Int>)>() |
| external ffi.Pointer<DIR> libc_shim_fdopendir(int fd, ffi.Pointer<ffi.Int> err); |
| |
| @ffi.Native< |
| ffi.Pointer<DIR> Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Int>) |
| >() |
| external ffi.Pointer<DIR> libc_shim_opendir( |
| ffi.Pointer<ffi.Char> path, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Pointer<dirent> Function(ffi.Pointer<DIR>, ffi.Pointer<ffi.Int>) |
| >() |
| external ffi.Pointer<dirent> libc_shim_readdir( |
| ffi.Pointer<DIR> d, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function(ffi.Pointer<pthread_cond_t>, ffi.Pointer<ffi.Int>) |
| >() |
| external int libc_shim_pthread_cond_broadcast( |
| ffi.Pointer<pthread_cond_t> cond, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function(ffi.Pointer<pthread_cond_t>, ffi.Pointer<ffi.Int>) |
| >() |
| external int libc_shim_pthread_cond_destroy( |
| ffi.Pointer<pthread_cond_t> cond, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<pthread_cond_t>, |
| ffi.Pointer<pthread_condattr_t>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_pthread_cond_init( |
| ffi.Pointer<pthread_cond_t> cond, |
| ffi.Pointer<pthread_condattr_t> attr, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function(ffi.Pointer<pthread_cond_t>, ffi.Pointer<ffi.Int>) |
| >() |
| external int libc_shim_pthread_cond_signal( |
| ffi.Pointer<pthread_cond_t> cond, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<pthread_cond_t>, |
| ffi.Pointer<pthread_mutex_t>, |
| ffi.Pointer<timespec>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_pthread_cond_timedwait( |
| ffi.Pointer<pthread_cond_t> cond, |
| ffi.Pointer<pthread_mutex_t> mutex, |
| ffi.Pointer<timespec> abstime, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<pthread_cond_t>, |
| ffi.Pointer<pthread_mutex_t>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_pthread_cond_wait( |
| ffi.Pointer<pthread_cond_t> cond, |
| ffi.Pointer<pthread_mutex_t> mutex, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<pthread_t>, |
| ffi.Pointer<pthread_attr_t>, |
| ffi.Pointer< |
| ffi.NativeFunction<ffi.Pointer<ffi.Void> Function(ffi.Pointer<ffi.Void>)> |
| >, |
| ffi.Pointer<ffi.Void>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_pthread_create( |
| ffi.Pointer<pthread_t> thread, |
| ffi.Pointer<pthread_attr_t> attr, |
| ffi.Pointer< |
| ffi.NativeFunction<ffi.Pointer<ffi.Void> Function(ffi.Pointer<ffi.Void>)> |
| > |
| start_routine, |
| ffi.Pointer<ffi.Void> arg, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native<ffi.Int Function(pthread_t, ffi.Pointer<ffi.Int>)>() |
| external int libc_shim_pthread_detach( |
| pthread_t thread, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function(ffi.Pointer<pthread_mutex_t>, ffi.Pointer<ffi.Int>) |
| >() |
| external int libc_shim_pthread_mutex_destroy( |
| ffi.Pointer<pthread_mutex_t> mutex, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<pthread_mutex_t>, |
| ffi.Pointer<pthread_mutexattr_t>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_pthread_mutex_init( |
| ffi.Pointer<pthread_mutex_t> mutex, |
| ffi.Pointer<pthread_mutexattr_t> attr, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function(ffi.Pointer<pthread_mutex_t>, ffi.Pointer<ffi.Int>) |
| >() |
| external int libc_shim_pthread_mutex_lock( |
| ffi.Pointer<pthread_mutex_t> mutex, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<pthread_mutex_t>, |
| ffi.Pointer<timespec>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_pthread_mutex_timedlock( |
| ffi.Pointer<pthread_mutex_t> mutex, |
| ffi.Pointer<timespec> abs_timeout, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function(ffi.Pointer<pthread_mutex_t>, ffi.Pointer<ffi.Int>) |
| >() |
| external int libc_shim_pthread_mutex_unlock( |
| ffi.Pointer<pthread_mutex_t> mutex, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<ffi.Char>, |
| ffi.Pointer<Stat>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_stat( |
| ffi.Pointer<ffi.Char> path, |
| ffi.Pointer<Stat> buf, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Pointer<ffi.Char>, |
| ffi.Pointer<Stat>, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_lstat( |
| ffi.Pointer<ffi.Char> path, |
| ffi.Pointer<Stat> buf, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function(ffi.Int, ffi.Pointer<Stat>, ffi.Pointer<ffi.Int>) |
| >() |
| external int libc_shim_fstat( |
| int fd, |
| ffi.Pointer<Stat> buf, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| @ffi.Native< |
| ffi.Int Function( |
| ffi.Int, |
| ffi.Pointer<ffi.Char>, |
| ffi.Pointer<Stat>, |
| ffi.Int, |
| ffi.Pointer<ffi.Int>, |
| ) |
| >() |
| external int libc_shim_fstatat( |
| int fd, |
| ffi.Pointer<ffi.Char> path, |
| ffi.Pointer<Stat> buf, |
| int flag, |
| ffi.Pointer<ffi.Int> err, |
| ); |
| |
| /// <dirent.h> |
| final class dirent extends ffi.Struct { |
| /// POSIX |
| @ffi.Int64() |
| external int d_ino; |
| |
| /// Linux, macOS/iOS |
| @ffi.Uint8() |
| external int d_type; |
| |
| /// POSIX; __DARWIN_MAXNAMLEN = 1024 |
| @ffi.Array.multi([1025]) |
| external ffi.Array<ffi.Char> d_name; |
| } |
| |
| final class DIR extends ffi.Struct { |
| external dirent libc_shim_dirent; |
| |
| external ffi.Pointer<ffi.Void> _dir; |
| } |
| |
| /// <pthread.h> |
| final class pthread_t extends ffi.Struct { |
| external ffi.Pointer<ffi.Void> _pthread_t; |
| } |
| |
| final class pthread_attr_t extends ffi.Struct { |
| external ffi.Pointer<ffi.Void> _pthread_attr_t; |
| } |
| |
| final class pthread_mutex_t extends ffi.Struct { |
| external ffi.Pointer<ffi.Void> _pthread_mutex_t; |
| } |
| |
| final class pthread_mutexattr_t extends ffi.Struct { |
| external ffi.Pointer<ffi.Void> _pthread_mutexattr_t; |
| } |
| |
| final class pthread_cond_t extends ffi.Struct { |
| external ffi.Pointer<ffi.Void> _pthread_cond_t; |
| } |
| |
| final class pthread_condattr_t extends ffi.Struct { |
| external ffi.Pointer<ffi.Void> _pthread_condattr_t; |
| } |
| |
| /// <sys/stat.h> |
| final class timespec extends ffi.Struct { |
| @ffi.Int64() |
| external int tv_sec; |
| |
| @ffi.Int64() |
| external int tv_nsec; |
| } |
| |
| final class Stat extends ffi.Struct { |
| @ffi.Int64() |
| external int st_dev; |
| |
| @ffi.Int64() |
| external int st_ino; |
| |
| @ffi.Int64() |
| external int st_mode; |
| |
| @ffi.Int64() |
| external int st_nlink; |
| |
| @ffi.Int64() |
| external int std_uid; |
| |
| @ffi.Int64() |
| external int st_size; |
| |
| external timespec st_atim; |
| |
| external timespec st_mtim; |
| |
| external timespec st_ctim; |
| |
| /// Only valid on macOS/iOS |
| external timespec st_btime; |
| |
| /// Only valid on macOS/iOS |
| @ffi.Int64() |
| external int st_flags; |
| } |