clash_generated_bindings.dart 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566
  1. // AUTO GENERATED FILE, DO NOT EDIT.
  2. //
  3. // Generated by `package:ffigen`.
  4. // ignore_for_file: type=lint
  5. import 'dart:ffi' as ffi;
  6. class NativeLibrary {
  7. /// Holds the symbol lookup function.
  8. final ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
  9. _lookup;
  10. /// The symbols are looked up in [dynamicLibrary].
  11. NativeLibrary(ffi.DynamicLibrary dynamicLibrary)
  12. : _lookup = dynamicLibrary.lookup;
  13. /// The symbols are looked up with [lookup].
  14. NativeLibrary.fromLookup(
  15. ffi.Pointer<T> Function<T extends ffi.NativeType>(String symbolName)
  16. lookup)
  17. : _lookup = lookup;
  18. int clash_init(
  19. ffi.Pointer<ffi.Char> home_dir,
  20. ) {
  21. return _clash_init(
  22. home_dir,
  23. );
  24. }
  25. late final _clash_initPtr =
  26. _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
  27. 'clash_init');
  28. late final _clash_init =
  29. _clash_initPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
  30. int set_config(
  31. ffi.Pointer<ffi.Char> config_path,
  32. ) {
  33. return _set_config(
  34. config_path,
  35. );
  36. }
  37. late final _set_configPtr =
  38. _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
  39. 'set_config');
  40. late final _set_config =
  41. _set_configPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
  42. int set_home_dir(
  43. ffi.Pointer<ffi.Char> home,
  44. ) {
  45. return _set_home_dir(
  46. home,
  47. );
  48. }
  49. late final _set_home_dirPtr =
  50. _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
  51. 'set_home_dir');
  52. late final _set_home_dir =
  53. _set_home_dirPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
  54. ffi.Pointer<ffi.Char> get_config() {
  55. return _get_config();
  56. }
  57. late final _get_configPtr =
  58. _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
  59. 'get_config');
  60. late final _get_config =
  61. _get_configPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
  62. int set_ext_controller(
  63. int port,
  64. ) {
  65. return _set_ext_controller(
  66. port,
  67. );
  68. }
  69. late final _set_ext_controllerPtr =
  70. _lookup<ffi.NativeFunction<GoInt Function(GoUint64)>>(
  71. 'set_ext_controller');
  72. late final _set_ext_controller =
  73. _set_ext_controllerPtr.asFunction<int Function(int)>();
  74. void clear_ext_options() {
  75. return _clear_ext_options();
  76. }
  77. late final _clear_ext_optionsPtr =
  78. _lookup<ffi.NativeFunction<ffi.Void Function()>>('clear_ext_options');
  79. late final _clear_ext_options =
  80. _clear_ext_optionsPtr.asFunction<void Function()>();
  81. int is_config_valid(
  82. ffi.Pointer<ffi.Char> config_path,
  83. ) {
  84. return _is_config_valid(
  85. config_path,
  86. );
  87. }
  88. late final _is_config_validPtr =
  89. _lookup<ffi.NativeFunction<GoInt Function(ffi.Pointer<ffi.Char>)>>(
  90. 'is_config_valid');
  91. late final _is_config_valid =
  92. _is_config_validPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
  93. ffi.Pointer<ffi.Char> get_all_connections() {
  94. return _get_all_connections();
  95. }
  96. late final _get_all_connectionsPtr =
  97. _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
  98. 'get_all_connections');
  99. late final _get_all_connections =
  100. _get_all_connectionsPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
  101. void close_all_connections() {
  102. return _close_all_connections();
  103. }
  104. late final _close_all_connectionsPtr =
  105. _lookup<ffi.NativeFunction<ffi.Void Function()>>('close_all_connections');
  106. late final _close_all_connections =
  107. _close_all_connectionsPtr.asFunction<void Function()>();
  108. int close_connection(
  109. ffi.Pointer<ffi.Char> id,
  110. ) {
  111. return _close_connection(
  112. id,
  113. );
  114. }
  115. late final _close_connectionPtr =
  116. _lookup<ffi.NativeFunction<GoUint8 Function(ffi.Pointer<ffi.Char>)>>(
  117. 'close_connection');
  118. late final _close_connection =
  119. _close_connectionPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
  120. int parse_options() {
  121. return _parse_options();
  122. }
  123. late final _parse_optionsPtr =
  124. _lookup<ffi.NativeFunction<GoUint8 Function()>>('parse_options');
  125. late final _parse_options = _parse_optionsPtr.asFunction<int Function()>();
  126. ffi.Pointer<ffi.Char> get_traffic() {
  127. return _get_traffic();
  128. }
  129. late final _get_trafficPtr =
  130. _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
  131. 'get_traffic');
  132. late final _get_traffic =
  133. _get_trafficPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
  134. void init_native_api_bridge(
  135. ffi.Pointer<ffi.Void> api,
  136. ) {
  137. return _init_native_api_bridge(
  138. api,
  139. );
  140. }
  141. late final _init_native_api_bridgePtr =
  142. _lookup<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>(
  143. 'init_native_api_bridge');
  144. late final _init_native_api_bridge = _init_native_api_bridgePtr
  145. .asFunction<void Function(ffi.Pointer<ffi.Void>)>();
  146. void start_log(
  147. int port,
  148. ) {
  149. return _start_log(
  150. port,
  151. );
  152. }
  153. late final _start_logPtr =
  154. _lookup<ffi.NativeFunction<ffi.Void Function(ffi.LongLong)>>('start_log');
  155. late final _start_log = _start_logPtr.asFunction<void Function(int)>();
  156. void stop_log() {
  157. return _stop_log();
  158. }
  159. late final _stop_logPtr =
  160. _lookup<ffi.NativeFunction<ffi.Void Function()>>('stop_log');
  161. late final _stop_log = _stop_logPtr.asFunction<void Function()>();
  162. int change_proxy(
  163. ffi.Pointer<ffi.Char> selector_name,
  164. ffi.Pointer<ffi.Char> proxy_name,
  165. ) {
  166. return _change_proxy(
  167. selector_name,
  168. proxy_name,
  169. );
  170. }
  171. late final _change_proxyPtr = _lookup<
  172. ffi.NativeFunction<
  173. ffi.Long Function(
  174. ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>>('change_proxy');
  175. late final _change_proxy = _change_proxyPtr
  176. .asFunction<int Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>)>();
  177. int change_config_field(
  178. ffi.Pointer<ffi.Char> s,
  179. ) {
  180. return _change_config_field(
  181. s,
  182. );
  183. }
  184. late final _change_config_fieldPtr =
  185. _lookup<ffi.NativeFunction<ffi.Long Function(ffi.Pointer<ffi.Char>)>>(
  186. 'change_config_field');
  187. late final _change_config_field =
  188. _change_config_fieldPtr.asFunction<int Function(ffi.Pointer<ffi.Char>)>();
  189. void async_test_delay(
  190. ffi.Pointer<ffi.Char> proxy_name,
  191. ffi.Pointer<ffi.Char> url,
  192. int timeout,
  193. int port,
  194. ) {
  195. return _async_test_delay(
  196. proxy_name,
  197. url,
  198. timeout,
  199. port,
  200. );
  201. }
  202. late final _async_test_delayPtr = _lookup<
  203. ffi.NativeFunction<
  204. ffi.Void Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>,
  205. ffi.Long, ffi.LongLong)>>('async_test_delay');
  206. late final _async_test_delay = _async_test_delayPtr.asFunction<
  207. void Function(ffi.Pointer<ffi.Char>, ffi.Pointer<ffi.Char>, int, int)>();
  208. ffi.Pointer<ffi.Char> get_proxies() {
  209. return _get_proxies();
  210. }
  211. late final _get_proxiesPtr =
  212. _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
  213. 'get_proxies');
  214. late final _get_proxies =
  215. _get_proxiesPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
  216. ffi.Pointer<ffi.Char> get_configs() {
  217. return _get_configs();
  218. }
  219. late final _get_configsPtr =
  220. _lookup<ffi.NativeFunction<ffi.Pointer<ffi.Char> Function()>>(
  221. 'get_configs');
  222. late final _get_configs =
  223. _get_configsPtr.asFunction<ffi.Pointer<ffi.Char> Function()>();
  224. }
  225. final class __mbstate_t extends ffi.Union {
  226. @ffi.Array.multi([128])
  227. external ffi.Array<ffi.Char> __mbstate8;
  228. @ffi.LongLong()
  229. external int _mbstateL;
  230. }
  231. final class __darwin_pthread_handler_rec extends ffi.Struct {
  232. external ffi
  233. .Pointer<ffi.NativeFunction<ffi.Void Function(ffi.Pointer<ffi.Void>)>>
  234. __routine;
  235. external ffi.Pointer<ffi.Void> __arg;
  236. external ffi.Pointer<__darwin_pthread_handler_rec> __next;
  237. }
  238. final class _opaque_pthread_attr_t extends ffi.Struct {
  239. @ffi.Long()
  240. external int __sig;
  241. @ffi.Array.multi([56])
  242. external ffi.Array<ffi.Char> __opaque;
  243. }
  244. final class _opaque_pthread_cond_t extends ffi.Struct {
  245. @ffi.Long()
  246. external int __sig;
  247. @ffi.Array.multi([40])
  248. external ffi.Array<ffi.Char> __opaque;
  249. }
  250. final class _opaque_pthread_condattr_t extends ffi.Struct {
  251. @ffi.Long()
  252. external int __sig;
  253. @ffi.Array.multi([8])
  254. external ffi.Array<ffi.Char> __opaque;
  255. }
  256. final class _opaque_pthread_mutex_t extends ffi.Struct {
  257. @ffi.Long()
  258. external int __sig;
  259. @ffi.Array.multi([56])
  260. external ffi.Array<ffi.Char> __opaque;
  261. }
  262. final class _opaque_pthread_mutexattr_t extends ffi.Struct {
  263. @ffi.Long()
  264. external int __sig;
  265. @ffi.Array.multi([8])
  266. external ffi.Array<ffi.Char> __opaque;
  267. }
  268. final class _opaque_pthread_once_t extends ffi.Struct {
  269. @ffi.Long()
  270. external int __sig;
  271. @ffi.Array.multi([8])
  272. external ffi.Array<ffi.Char> __opaque;
  273. }
  274. final class _opaque_pthread_rwlock_t extends ffi.Struct {
  275. @ffi.Long()
  276. external int __sig;
  277. @ffi.Array.multi([192])
  278. external ffi.Array<ffi.Char> __opaque;
  279. }
  280. final class _opaque_pthread_rwlockattr_t extends ffi.Struct {
  281. @ffi.Long()
  282. external int __sig;
  283. @ffi.Array.multi([16])
  284. external ffi.Array<ffi.Char> __opaque;
  285. }
  286. final class _opaque_pthread_t extends ffi.Struct {
  287. @ffi.Long()
  288. external int __sig;
  289. external ffi.Pointer<__darwin_pthread_handler_rec> __cleanup_stack;
  290. @ffi.Array.multi([8176])
  291. external ffi.Array<ffi.Char> __opaque;
  292. }
  293. final class _GoString_ extends ffi.Struct {
  294. external ffi.Pointer<ffi.Char> p;
  295. @ptrdiff_t()
  296. external int n;
  297. }
  298. typedef ptrdiff_t = __darwin_ptrdiff_t;
  299. typedef __darwin_ptrdiff_t = ffi.Long;
  300. final class GoInterface extends ffi.Struct {
  301. external ffi.Pointer<ffi.Void> t;
  302. external ffi.Pointer<ffi.Void> v;
  303. }
  304. final class GoSlice extends ffi.Struct {
  305. external ffi.Pointer<ffi.Void> data;
  306. @GoInt()
  307. external int len;
  308. @GoInt()
  309. external int cap;
  310. }
  311. typedef GoInt = GoInt64;
  312. typedef GoInt64 = ffi.LongLong;
  313. typedef GoUint64 = ffi.UnsignedLongLong;
  314. typedef GoUint8 = ffi.UnsignedChar;
  315. const int __DARWIN_ONLY_64_BIT_INO_T = 1;
  316. const int __DARWIN_ONLY_UNIX_CONFORMANCE = 1;
  317. const int __DARWIN_ONLY_VERS_1050 = 1;
  318. const int __DARWIN_UNIX03 = 1;
  319. const int __DARWIN_64_BIT_INO_T = 1;
  320. const int __DARWIN_VERS_1050 = 1;
  321. const int __DARWIN_NON_CANCELABLE = 0;
  322. const String __DARWIN_SUF_EXTSN = '\$DARWIN_EXTSN';
  323. const int __DARWIN_C_ANSI = 4096;
  324. const int __DARWIN_C_FULL = 900000;
  325. const int __DARWIN_C_LEVEL = 900000;
  326. const int __STDC_WANT_LIB_EXT1__ = 1;
  327. const int __DARWIN_NO_LONG_LONG = 0;
  328. const int _DARWIN_FEATURE_64_BIT_INODE = 1;
  329. const int _DARWIN_FEATURE_ONLY_64_BIT_INODE = 1;
  330. const int _DARWIN_FEATURE_ONLY_VERS_1050 = 1;
  331. const int _DARWIN_FEATURE_ONLY_UNIX_CONFORMANCE = 1;
  332. const int _DARWIN_FEATURE_UNIX_CONFORMANCE = 3;
  333. const int __has_ptrcheck = 0;
  334. const int __DARWIN_NULL = 0;
  335. const int __PTHREAD_SIZE__ = 8176;
  336. const int __PTHREAD_ATTR_SIZE__ = 56;
  337. const int __PTHREAD_MUTEXATTR_SIZE__ = 8;
  338. const int __PTHREAD_MUTEX_SIZE__ = 56;
  339. const int __PTHREAD_CONDATTR_SIZE__ = 8;
  340. const int __PTHREAD_COND_SIZE__ = 40;
  341. const int __PTHREAD_ONCE_SIZE__ = 8;
  342. const int __PTHREAD_RWLOCK_SIZE__ = 192;
  343. const int __PTHREAD_RWLOCKATTR_SIZE__ = 16;
  344. const int __DARWIN_WCHAR_MAX = 2147483647;
  345. const int __DARWIN_WCHAR_MIN = -2147483648;
  346. const int __DARWIN_WEOF = -1;
  347. const int _FORTIFY_SOURCE = 2;
  348. const int NULL = 0;
  349. const int USER_ADDR_NULL = 0;
  350. const int __WORDSIZE = 64;
  351. const int INT8_MAX = 127;
  352. const int INT16_MAX = 32767;
  353. const int INT32_MAX = 2147483647;
  354. const int INT64_MAX = 9223372036854775807;
  355. const int INT8_MIN = -128;
  356. const int INT16_MIN = -32768;
  357. const int INT32_MIN = -2147483648;
  358. const int INT64_MIN = -9223372036854775808;
  359. const int UINT8_MAX = 255;
  360. const int UINT16_MAX = 65535;
  361. const int UINT32_MAX = 4294967295;
  362. const int UINT64_MAX = -1;
  363. const int INT_LEAST8_MIN = -128;
  364. const int INT_LEAST16_MIN = -32768;
  365. const int INT_LEAST32_MIN = -2147483648;
  366. const int INT_LEAST64_MIN = -9223372036854775808;
  367. const int INT_LEAST8_MAX = 127;
  368. const int INT_LEAST16_MAX = 32767;
  369. const int INT_LEAST32_MAX = 2147483647;
  370. const int INT_LEAST64_MAX = 9223372036854775807;
  371. const int UINT_LEAST8_MAX = 255;
  372. const int UINT_LEAST16_MAX = 65535;
  373. const int UINT_LEAST32_MAX = 4294967295;
  374. const int UINT_LEAST64_MAX = -1;
  375. const int INT_FAST8_MIN = -128;
  376. const int INT_FAST16_MIN = -32768;
  377. const int INT_FAST32_MIN = -2147483648;
  378. const int INT_FAST64_MIN = -9223372036854775808;
  379. const int INT_FAST8_MAX = 127;
  380. const int INT_FAST16_MAX = 32767;
  381. const int INT_FAST32_MAX = 2147483647;
  382. const int INT_FAST64_MAX = 9223372036854775807;
  383. const int UINT_FAST8_MAX = 255;
  384. const int UINT_FAST16_MAX = 65535;
  385. const int UINT_FAST32_MAX = 4294967295;
  386. const int UINT_FAST64_MAX = -1;
  387. const int INTPTR_MAX = 9223372036854775807;
  388. const int INTPTR_MIN = -9223372036854775808;
  389. const int UINTPTR_MAX = -1;
  390. const int INTMAX_MAX = 9223372036854775807;
  391. const int UINTMAX_MAX = -1;
  392. const int INTMAX_MIN = -9223372036854775808;
  393. const int PTRDIFF_MIN = -9223372036854775808;
  394. const int PTRDIFF_MAX = 9223372036854775807;
  395. const int SIZE_MAX = -1;
  396. const int RSIZE_MAX = 9223372036854775807;
  397. const int WCHAR_MAX = 2147483647;
  398. const int WCHAR_MIN = -2147483648;
  399. const int WINT_MIN = -2147483648;
  400. const int WINT_MAX = 2147483647;
  401. const int SIG_ATOMIC_MIN = -2147483648;
  402. const int SIG_ATOMIC_MAX = 2147483647;