11/// bindings for `libkeystore`
22
3- import 'dart:ffi' ;
43import 'dart:io' ;
4+ import 'dart:ffi' ;
55import 'package:ffi/ffi.dart' as ffi;
66
77// ignore_for_file: unused_import, camel_case_types, non_constant_identifier_names
@@ -13,50 +13,50 @@ DynamicLibrary _open() {
1313 throw UnsupportedError ('This platform is not supported.' );
1414}
1515
16- /// C function `keystore_lock ` .
17- int keystore_lock (
18- Pointer keystore ,
16+ /// C function `account_destroy ` .
17+ void account_destroy (
18+ Pointer account ,
1919) {
20- return _keystore_lock (keystore );
20+ _account_destroy (account );
2121}
22- final _keystore_lock_Dart _keystore_lock = _dl.lookupFunction <_keystore_lock_C, _keystore_lock_Dart >('keystore_lock ' );
23- typedef _keystore_lock_C = Int32 Function (
24- Pointer keystore ,
22+ final _account_destroy_Dart _account_destroy = _dl.lookupFunction <_account_destroy_C, _account_destroy_Dart >('account_destroy ' );
23+ typedef _account_destroy_C = Void Function (
24+ Pointer account ,
2525);
26- typedef _keystore_lock_Dart = int Function (
27- Pointer keystore ,
26+ typedef _account_destroy_Dart = void Function (
27+ Pointer account ,
2828);
2929
30- /// C function `keystore_phrase ` .
31- Pointer <ffi. Utf8 > keystore_phrase (
32- Pointer keystore ,
33- Pointer <ffi. Utf8 > password ,
30+ /// C function `error_message_utf8 ` .
31+ int error_message_utf8 (
32+ Pointer <ffi. Utf8 > buf ,
33+ int length ,
3434) {
35- return _keystore_phrase (keystore, password );
35+ return _error_message_utf8 (buf, length );
3636}
37- final _keystore_phrase_Dart _keystore_phrase = _dl.lookupFunction <_keystore_phrase_C, _keystore_phrase_Dart >('keystore_phrase ' );
38- typedef _keystore_phrase_C = Pointer <ffi. Utf8 > Function (
39- Pointer keystore ,
40- Pointer <ffi. Utf8 > password ,
37+ final _error_message_utf8_Dart _error_message_utf8 = _dl.lookupFunction <_error_message_utf8_C, _error_message_utf8_Dart >('error_message_utf8 ' );
38+ typedef _error_message_utf8_C = Int32 Function (
39+ Pointer <ffi. Utf8 > buf ,
40+ Int32 length ,
4141);
42- typedef _keystore_phrase_Dart = Pointer <ffi. Utf8 > Function (
43- Pointer keystore ,
44- Pointer <ffi. Utf8 > password ,
42+ typedef _error_message_utf8_Dart = int Function (
43+ Pointer <ffi. Utf8 > buf ,
44+ int length ,
4545);
4646
47- /// C function `keystore_unlock ` .
48- int keystore_unlock (
47+ /// C function `keystore_generate ` .
48+ int keystore_generate (
4949 Pointer keystore,
5050 Pointer <ffi.Utf8 > password,
5151) {
52- return _keystore_unlock (keystore, password);
52+ return _keystore_generate (keystore, password);
5353}
54- final _keystore_unlock_Dart _keystore_unlock = _dl.lookupFunction <_keystore_unlock_C, _keystore_unlock_Dart >('keystore_unlock ' );
55- typedef _keystore_unlock_C = Int32 Function (
54+ final _keystore_generate_Dart _keystore_generate = _dl.lookupFunction <_keystore_generate_C, _keystore_generate_Dart >('keystore_generate ' );
55+ typedef _keystore_generate_C = Int32 Function (
5656 Pointer keystore,
5757 Pointer <ffi.Utf8 > password,
5858);
59- typedef _keystore_unlock_Dart = int Function (
59+ typedef _keystore_generate_Dart = int Function (
6060 Pointer keystore,
6161 Pointer <ffi.Utf8 > password,
6262);
@@ -75,23 +75,6 @@ typedef _keystore_destroy_Dart = void Function(
7575 Pointer keystore,
7676);
7777
78- /// C function `keystore_generate` .
79- int keystore_generate (
80- Pointer keystore,
81- Pointer <ffi.Utf8 > password,
82- ) {
83- return _keystore_generate (keystore, password);
84- }
85- final _keystore_generate_Dart _keystore_generate = _dl.lookupFunction <_keystore_generate_C, _keystore_generate_Dart>('keystore_generate' );
86- typedef _keystore_generate_C = Int32 Function (
87- Pointer keystore,
88- Pointer <ffi.Utf8 > password,
89- );
90- typedef _keystore_generate_Dart = int Function (
91- Pointer keystore,
92- Pointer <ffi.Utf8 > password,
93- );
94-
9578/// C function `keystore_account` .
9679Pointer keystore_account (
9780 Pointer keystore,
@@ -120,35 +103,18 @@ typedef _keystore_status_Dart = int Function(
120103 Pointer keystore,
121104);
122105
123- /// C function `error_message_utf8` .
124- int error_message_utf8 (
125- Pointer <ffi.Utf8 > buf,
126- int length,
127- ) {
128- return _error_message_utf8 (buf, length);
129- }
130- final _error_message_utf8_Dart _error_message_utf8 = _dl.lookupFunction <_error_message_utf8_C, _error_message_utf8_Dart>('error_message_utf8' );
131- typedef _error_message_utf8_C = Int32 Function (
132- Pointer <ffi.Utf8 > buf,
133- Int32 length,
134- );
135- typedef _error_message_utf8_Dart = int Function (
136- Pointer <ffi.Utf8 > buf,
137- int length,
138- );
139-
140- /// C function `phrase_destroy` .
141- void phrase_destroy (
142- Pointer <ffi.Utf8 > phrase,
106+ /// C function `keystore_lock` .
107+ int keystore_lock (
108+ Pointer keystore,
143109) {
144- _phrase_destroy (phrase );
110+ return _keystore_lock (keystore );
145111}
146- final _phrase_destroy_Dart _phrase_destroy = _dl.lookupFunction <_phrase_destroy_C, _phrase_destroy_Dart >('phrase_destroy ' );
147- typedef _phrase_destroy_C = Void Function (
148- Pointer <ffi. Utf8 > phrase ,
112+ final _keystore_lock_Dart _keystore_lock = _dl.lookupFunction <_keystore_lock_C, _keystore_lock_Dart >('keystore_lock ' );
113+ typedef _keystore_lock_C = Int32 Function (
114+ Pointer keystore ,
149115);
150- typedef _phrase_destroy_Dart = void Function (
151- Pointer <ffi. Utf8 > phrase ,
116+ typedef _keystore_lock_Dart = int Function (
117+ Pointer keystore ,
152118);
153119
154120/// C function `keystore_new` .
@@ -159,32 +125,46 @@ final _keystore_new_Dart _keystore_new = _dl.lookupFunction<_keystore_new_C, _ke
159125typedef _keystore_new_C = Pointer Function ();
160126typedef _keystore_new_Dart = Pointer Function ();
161127
162- /// C function `keystore_paper_backup` .
163- int keystore_paper_backup (
128+ /// C function `last_error_length` .
129+ int last_error_length () {
130+ return _last_error_length ();
131+ }
132+ final _last_error_length_Dart _last_error_length = _dl.lookupFunction <_last_error_length_C, _last_error_length_Dart>('last_error_length' );
133+ typedef _last_error_length_C = Int32 Function ();
134+ typedef _last_error_length_Dart = int Function ();
135+
136+ /// C function `keystore_phrase` .
137+ Pointer <ffi.Utf8 > keystore_phrase (
164138 Pointer keystore,
139+ Pointer <ffi.Utf8 > password,
165140) {
166- return _keystore_paper_backup (keystore);
141+ return _keystore_phrase (keystore, password );
167142}
168- final _keystore_paper_backup_Dart _keystore_paper_backup = _dl.lookupFunction <_keystore_paper_backup_C, _keystore_paper_backup_Dart >('keystore_paper_backup ' );
169- typedef _keystore_paper_backup_C = Int32 Function (
143+ final _keystore_phrase_Dart _keystore_phrase = _dl.lookupFunction <_keystore_phrase_C, _keystore_phrase_Dart >('keystore_phrase ' );
144+ typedef _keystore_phrase_C = Pointer <ffi. Utf8 > Function (
170145 Pointer keystore,
146+ Pointer <ffi.Utf8 > password,
171147);
172- typedef _keystore_paper_backup_Dart = int Function (
148+ typedef _keystore_phrase_Dart = Pointer <ffi. Utf8 > Function (
173149 Pointer keystore,
150+ Pointer <ffi.Utf8 > password,
174151);
175152
176- /// C function `keystore_set_paper_backup ` .
177- int keystore_set_paper_backup (
153+ /// C function `keystore_unlock ` .
154+ int keystore_unlock (
178155 Pointer keystore,
156+ Pointer <ffi.Utf8 > password,
179157) {
180- return _keystore_set_paper_backup (keystore);
158+ return _keystore_unlock (keystore, password );
181159}
182- final _keystore_set_paper_backup_Dart _keystore_set_paper_backup = _dl.lookupFunction <_keystore_set_paper_backup_C, _keystore_set_paper_backup_Dart >('keystore_set_paper_backup ' );
183- typedef _keystore_set_paper_backup_C = Int32 Function (
160+ final _keystore_unlock_Dart _keystore_unlock = _dl.lookupFunction <_keystore_unlock_C, _keystore_unlock_Dart >('keystore_unlock ' );
161+ typedef _keystore_unlock_C = Int32 Function (
184162 Pointer keystore,
163+ Pointer <ffi.Utf8 > password,
185164);
186- typedef _keystore_set_paper_backup_Dart = int Function (
165+ typedef _keystore_unlock_Dart = int Function (
187166 Pointer keystore,
167+ Pointer <ffi.Utf8 > password,
188168);
189169
190170/// C function `keystore_from_keyfile` .
@@ -201,27 +181,47 @@ typedef _keystore_from_keyfile_Dart = Pointer Function(
201181 Pointer <ffi.Utf8 > path,
202182);
203183
204- /// C function `account_destroy ` .
205- void account_destroy (
206- Pointer account ,
184+ /// C function `keystore_paper_backup ` .
185+ int keystore_paper_backup (
186+ Pointer keystore ,
207187) {
208- _account_destroy (account );
188+ return _keystore_paper_backup (keystore );
209189}
210- final _account_destroy_Dart _account_destroy = _dl.lookupFunction <_account_destroy_C, _account_destroy_Dart >('account_destroy ' );
211- typedef _account_destroy_C = Void Function (
212- Pointer account ,
190+ final _keystore_paper_backup_Dart _keystore_paper_backup = _dl.lookupFunction <_keystore_paper_backup_C, _keystore_paper_backup_Dart >('keystore_paper_backup ' );
191+ typedef _keystore_paper_backup_C = Int32 Function (
192+ Pointer keystore ,
213193);
214- typedef _account_destroy_Dart = void Function (
215- Pointer account ,
194+ typedef _keystore_paper_backup_Dart = int Function (
195+ Pointer keystore ,
216196);
217197
218- /// C function `last_error_length` .
219- int last_error_length () {
220- return _last_error_length ();
198+ /// C function `keystore_set_paper_backup` .
199+ int keystore_set_paper_backup (
200+ Pointer keystore,
201+ ) {
202+ return _keystore_set_paper_backup (keystore);
221203}
222- final _last_error_length_Dart _last_error_length = _dl.lookupFunction <_last_error_length_C, _last_error_length_Dart>('last_error_length' );
223- typedef _last_error_length_C = Int32 Function ();
224- typedef _last_error_length_Dart = int Function ();
204+ final _keystore_set_paper_backup_Dart _keystore_set_paper_backup = _dl.lookupFunction <_keystore_set_paper_backup_C, _keystore_set_paper_backup_Dart>('keystore_set_paper_backup' );
205+ typedef _keystore_set_paper_backup_C = Int32 Function (
206+ Pointer keystore,
207+ );
208+ typedef _keystore_set_paper_backup_Dart = int Function (
209+ Pointer keystore,
210+ );
211+
212+ /// C function `phrase_destroy` .
213+ void phrase_destroy (
214+ Pointer <ffi.Utf8 > phrase,
215+ ) {
216+ _phrase_destroy (phrase);
217+ }
218+ final _phrase_destroy_Dart _phrase_destroy = _dl.lookupFunction <_phrase_destroy_C, _phrase_destroy_Dart>('phrase_destroy' );
219+ typedef _phrase_destroy_C = Void Function (
220+ Pointer <ffi.Utf8 > phrase,
221+ );
222+ typedef _phrase_destroy_Dart = void Function (
223+ Pointer <ffi.Utf8 > phrase,
224+ );
225225
226226/// C function `keystore_import` .
227227int keystore_import (
0 commit comments