1pub const HOOKAPI_INCLUDED: u32 = 1;
4pub const _STDINT_H: u32 = 1;
5pub const _FEATURES_H: u32 = 1;
6pub const _DEFAULT_SOURCE: u32 = 1;
7pub const __GLIBC_USE_ISOC2X: u32 = 0;
8pub const __USE_ISOC11: u32 = 1;
9pub const __USE_ISOC99: u32 = 1;
10pub const __USE_ISOC95: u32 = 1;
11pub const __USE_POSIX_IMPLICITLY: u32 = 1;
12pub const _POSIX_SOURCE: u32 = 1;
13pub const _POSIX_C_SOURCE: u32 = 200809;
14pub const __USE_POSIX: u32 = 1;
15pub const __USE_POSIX2: u32 = 1;
16pub const __USE_POSIX199309: u32 = 1;
17pub const __USE_POSIX199506: u32 = 1;
18pub const __USE_XOPEN2K: u32 = 1;
19pub const __USE_XOPEN2K8: u32 = 1;
20pub const _ATFILE_SOURCE: u32 = 1;
21pub const __USE_MISC: u32 = 1;
22pub const __USE_ATFILE: u32 = 1;
23pub const __USE_FORTIFY_LEVEL: u32 = 0;
24pub const __GLIBC_USE_DEPRECATED_GETS: u32 = 0;
25pub const __GLIBC_USE_DEPRECATED_SCANF: u32 = 0;
26pub const _STDC_PREDEF_H: u32 = 1;
27pub const __STDC_IEC_559__: u32 = 1;
28pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
29pub const __STDC_ISO_10646__: u32 = 201706;
30pub const __GNU_LIBRARY__: u32 = 6;
31pub const __GLIBC__: u32 = 2;
32pub const __GLIBC_MINOR__: u32 = 31;
33pub const _SYS_CDEFS_H: u32 = 1;
34pub const __glibc_c99_flexarr_available: u32 = 1;
35pub const __WORDSIZE: u32 = 64;
36pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
37pub const __SYSCALL_WORDSIZE: u32 = 64;
38pub const __LONG_DOUBLE_USES_FLOAT128: u32 = 0;
39pub const __HAVE_GENERIC_SELECTION: u32 = 1;
40pub const __GLIBC_USE_LIB_EXT2: u32 = 0;
41pub const __GLIBC_USE_IEC_60559_BFP_EXT: u32 = 0;
42pub const __GLIBC_USE_IEC_60559_BFP_EXT_C2X: u32 = 0;
43pub const __GLIBC_USE_IEC_60559_FUNCS_EXT: u32 = 0;
44pub const __GLIBC_USE_IEC_60559_FUNCS_EXT_C2X: u32 = 0;
45pub const __GLIBC_USE_IEC_60559_TYPES_EXT: u32 = 0;
46pub const _BITS_TYPES_H: u32 = 1;
47pub const __TIMESIZE: u32 = 64;
48pub const _BITS_TYPESIZES_H: u32 = 1;
49pub const __OFF_T_MATCHES_OFF64_T: u32 = 1;
50pub const __INO_T_MATCHES_INO64_T: u32 = 1;
51pub const __RLIM_T_MATCHES_RLIM64_T: u32 = 1;
52pub const __STATFS_MATCHES_STATFS64: u32 = 1;
53pub const __FD_SETSIZE: u32 = 1024;
54pub const _BITS_TIME64_H: u32 = 1;
55pub const _BITS_WCHAR_H: u32 = 1;
56pub const _BITS_STDINT_INTN_H: u32 = 1;
57pub const _BITS_STDINT_UINTN_H: u32 = 1;
58pub const INT8_MIN: i32 = -128;
59pub const INT16_MIN: i32 = -32768;
60pub const INT32_MIN: i32 = -2147483648;
61pub const INT8_MAX: u32 = 127;
62pub const INT16_MAX: u32 = 32767;
63pub const INT32_MAX: u32 = 2147483647;
64pub const UINT8_MAX: u32 = 255;
65pub const UINT16_MAX: u32 = 65535;
66pub const UINT32_MAX: u32 = 4294967295;
67pub const INT_LEAST8_MIN: i32 = -128;
68pub const INT_LEAST16_MIN: i32 = -32768;
69pub const INT_LEAST32_MIN: i32 = -2147483648;
70pub const INT_LEAST8_MAX: u32 = 127;
71pub const INT_LEAST16_MAX: u32 = 32767;
72pub const INT_LEAST32_MAX: u32 = 2147483647;
73pub const UINT_LEAST8_MAX: u32 = 255;
74pub const UINT_LEAST16_MAX: u32 = 65535;
75pub const UINT_LEAST32_MAX: u32 = 4294967295;
76pub const INT_FAST8_MIN: i32 = -128;
77pub const INT_FAST16_MIN: i64 = -9223372036854775808;
78pub const INT_FAST32_MIN: i64 = -9223372036854775808;
79pub const INT_FAST8_MAX: u32 = 127;
80pub const INT_FAST16_MAX: u64 = 9223372036854775807;
81pub const INT_FAST32_MAX: u64 = 9223372036854775807;
82pub const UINT_FAST8_MAX: u32 = 255;
83pub const UINT_FAST16_MAX: i32 = -1;
84pub const UINT_FAST32_MAX: i32 = -1;
85pub const INTPTR_MIN: i64 = -9223372036854775808;
86pub const INTPTR_MAX: u64 = 9223372036854775807;
87pub const UINTPTR_MAX: i32 = -1;
88pub const PTRDIFF_MIN: i64 = -9223372036854775808;
89pub const PTRDIFF_MAX: u64 = 9223372036854775807;
90pub const SIG_ATOMIC_MIN: i32 = -2147483648;
91pub const SIG_ATOMIC_MAX: u32 = 2147483647;
92pub const SIZE_MAX: i32 = -1;
93pub const WINT_MIN: u32 = 0;
94pub const WINT_MAX: u32 = 4294967295;
95pub const SUCCESS: u32 = 0;
96pub const OUT_OF_BOUNDS: i32 = -1;
97pub const INTERNAL_ERROR: i32 = -2;
98pub const TOO_BIG: i32 = -3;
99pub const TOO_SMALL: i32 = -4;
100pub const DOESNT_EXIST: i32 = -5;
101pub const NO_FREE_SLOTS: i32 = -6;
102pub const INVALID_ARGUMENT: i32 = -7;
103pub const ALREADY_SET: i32 = -8;
104pub const PREREQUISITE_NOT_MET: i32 = -9;
105pub const FEE_TOO_LARGE: i32 = -10;
106pub const EMISSION_FAILURE: i32 = -11;
107pub const TOO_MANY_NONCES: i32 = -12;
108pub const TOO_MANY_EMITTED_TXN: i32 = -13;
109pub const NOT_IMPLEMENTED: i32 = -14;
110pub const INVALID_ACCOUNT: i32 = -15;
111pub const GUARD_VIOLATION: i32 = -16;
112pub const INVALID_FIELD: i32 = -17;
113pub const PARSE_ERROR: i32 = -18;
114pub const RC_ROLLBACK: i32 = -19;
115pub const RC_ACCEPT: i32 = -20;
116pub const NO_SUCH_KEYLET: i32 = -21;
117pub const INVALID_FLOAT: i32 = -10024;
118pub const KEYLET_HOOK: u32 = 1;
119pub const KEYLET_HOOK_STATE: u32 = 2;
120pub const KEYLET_ACCOUNT: u32 = 3;
121pub const KEYLET_AMENDMENTS: u32 = 4;
122pub const KEYLET_CHILD: u32 = 5;
123pub const KEYLET_SKIP: u32 = 6;
124pub const KEYLET_FEES: u32 = 7;
125pub const KEYLET_NEGATIVE_UNL: u32 = 8;
126pub const KEYLET_LINE: u32 = 9;
127pub const KEYLET_OFFER: u32 = 10;
128pub const KEYLET_QUALITY: u32 = 11;
129pub const KEYLET_EMITTED_DIR: u32 = 12;
130pub const KEYLET_TICKET: u32 = 13;
131pub const KEYLET_SIGNERS: u32 = 14;
132pub const KEYLET_CHECK: u32 = 15;
133pub const KEYLET_DEPOSIT_PREAUTH: u32 = 16;
134pub const KEYLET_UNCHECKED: u32 = 17;
135pub const KEYLET_OWNER_DIR: u32 = 18;
136pub const KEYLET_PAGE: u32 = 19;
137pub const KEYLET_ESCROW: u32 = 20;
138pub const KEYLET_PAYCHAN: u32 = 21;
139pub const KEYLET_EMITTED: u32 = 22;
140pub const COMPARE_EQUAL: u32 = 1;
141pub const COMPARE_LESS: u32 = 2;
142pub const COMPARE_GREATER: u32 = 4;
143pub const sfInvalid: i32 = -1;
144pub const sfGeneric: u32 = 0;
145pub const sfLedgerEntry: u32 = 655491329;
146pub const sfTransaction: u32 = 655425793;
147pub const sfValidation: u32 = 655556865;
148pub const sfMetadata: u32 = 655622401;
149pub const sfHash: u32 = 327937;
150pub const sfIndex: u32 = 327938;
151pub const sfCloseResolution: u32 = 1048577;
152pub const sfMethod: u32 = 1048578;
153pub const sfTransactionResult: u32 = 1048579;
154pub const sfTickSize: u32 = 1048592;
155pub const sfUNLModifyDisabling: u32 = 1048593;
156pub const sfLedgerEntryType: u32 = 65537;
157pub const sfTransactionType: u32 = 65538;
158pub const sfSignerWeight: u32 = 65539;
159pub const sfVersion: u32 = 65552;
160pub const sfFlags: u32 = 131074;
161pub const sfSourceTag: u32 = 131075;
162pub const sfSequence: u32 = 131076;
163pub const sfPreviousTxnLgrSeq: u32 = 131077;
164pub const sfLedgerSequence: u32 = 131078;
165pub const sfCloseTime: u32 = 131079;
166pub const sfParentCloseTime: u32 = 131080;
167pub const sfSigningTime: u32 = 131081;
168pub const sfExpiration: u32 = 131082;
169pub const sfTransferRate: u32 = 131083;
170pub const sfWalletSize: u32 = 131084;
171pub const sfOwnerCount: u32 = 131085;
172pub const sfDestinationTag: u32 = 131086;
173pub const sfHighQualityIn: u32 = 131088;
174pub const sfHighQualityOut: u32 = 131089;
175pub const sfLowQualityIn: u32 = 131090;
176pub const sfLowQualityOut: u32 = 131091;
177pub const sfQualityIn: u32 = 131092;
178pub const sfQualityOut: u32 = 131093;
179pub const sfStampEscrow: u32 = 131094;
180pub const sfBondAmount: u32 = 131095;
181pub const sfLoadFee: u32 = 131096;
182pub const sfOfferSequence: u32 = 131097;
183pub const sfFirstLedgerSequence: u32 = 131098;
184pub const sfLastLedgerSequence: u32 = 131099;
185pub const sfTransactionIndex: u32 = 131100;
186pub const sfOperationLimit: u32 = 131101;
187pub const sfReferenceFeeUnits: u32 = 131102;
188pub const sfReserveBase: u32 = 131103;
189pub const sfReserveIncrement: u32 = 131104;
190pub const sfSetFlag: u32 = 131105;
191pub const sfClearFlag: u32 = 131106;
192pub const sfSignerQuorum: u32 = 131107;
193pub const sfCancelAfter: u32 = 131108;
194pub const sfFinishAfter: u32 = 131109;
195pub const sfSignerListID: u32 = 131110;
196pub const sfSettleDelay: u32 = 131111;
197pub const sfHookStateCount: u32 = 131112;
198pub const sfHookReserveCount: u32 = 131113;
199pub const sfHookDataMaxSize: u32 = 131114;
200pub const sfEmitGeneration: u32 = 131115;
201pub const sfIndexNext: u32 = 196609;
202pub const sfIndexPrevious: u32 = 196610;
203pub const sfBookNode: u32 = 196611;
204pub const sfOwnerNode: u32 = 196612;
205pub const sfBaseFee: u32 = 196613;
206pub const sfExchangeRate: u32 = 196614;
207pub const sfLowNode: u32 = 196615;
208pub const sfHighNode: u32 = 196616;
209pub const sfDestinationNode: u32 = 196617;
210pub const sfCookie: u32 = 196618;
211pub const sfServerVersion: u32 = 196619;
212pub const sfEmitBurden: u32 = 196620;
213pub const sfHookOn: u32 = 196624;
214pub const sfEmailHash: u32 = 262145;
215pub const sfTakerPaysCurrency: u32 = 1114113;
216pub const sfTakerPaysIssuer: u32 = 1114114;
217pub const sfTakerGetsCurrency: u32 = 1114115;
218pub const sfTakerGetsIssuer: u32 = 1114116;
219pub const sfLedgerHash: u32 = 327681;
220pub const sfParentHash: u32 = 327682;
221pub const sfTransactionHash: u32 = 327683;
222pub const sfAccountHash: u32 = 327684;
223pub const sfPreviousTxnID: u32 = 327685;
224pub const sfLedgerIndex: u32 = 327686;
225pub const sfWalletLocator: u32 = 327687;
226pub const sfRootIndex: u32 = 327688;
227pub const sfAccountTxnID: u32 = 327689;
228pub const sfEmitParentTxnID: u32 = 327690;
229pub const sfEmitNonce: u32 = 327691;
230pub const sfBookDirectory: u32 = 327696;
231pub const sfInvoiceID: u32 = 327697;
232pub const sfNickname: u32 = 327698;
233pub const sfAmendment: u32 = 327699;
234pub const sfTicketID: u32 = 327700;
235pub const sfDigest: u32 = 327701;
236pub const sfPayChannel: u32 = 327702;
237pub const sfConsensusHash: u32 = 327703;
238pub const sfCheckID: u32 = 327704;
239pub const sfValidatedHash: u32 = 327705;
240pub const sfAmount: u32 = 393217;
241pub const sfBalance: u32 = 393218;
242pub const sfLimitAmount: u32 = 393219;
243pub const sfTakerPays: u32 = 393220;
244pub const sfTakerGets: u32 = 393221;
245pub const sfLowLimit: u32 = 393222;
246pub const sfHighLimit: u32 = 393223;
247pub const sfFee: u32 = 393224;
248pub const sfSendMax: u32 = 393225;
249pub const sfDeliverMin: u32 = 393226;
250pub const sfMinimumOffer: u32 = 393232;
251pub const sfRippleEscrow: u32 = 393233;
252pub const sfDeliveredAmount: u32 = 393234;
253pub const sfPublicKey: u32 = 458753;
254pub const sfMessageKey: u32 = 458754;
255pub const sfSigningPubKey: u32 = 458755;
256pub const sfTxnSignature: u32 = 458756;
257pub const sfSignature: u32 = 458758;
258pub const sfDomain: u32 = 458759;
259pub const sfFundCode: u32 = 458760;
260pub const sfRemoveCode: u32 = 458761;
261pub const sfExpireCode: u32 = 458762;
262pub const sfCreateCode: u32 = 458763;
263pub const sfMemoType: u32 = 458764;
264pub const sfMemoData: u32 = 458765;
265pub const sfMemoFormat: u32 = 458766;
266pub const sfFulfillment: u32 = 458768;
267pub const sfCondition: u32 = 458769;
268pub const sfMasterSignature: u32 = 458770;
269pub const sfUNLModifyValidator: u32 = 458771;
270pub const sfNegativeUNLToDisable: u32 = 458772;
271pub const sfNegativeUNLToReEnable: u32 = 458773;
272pub const sfHookData: u32 = 458774;
273pub const sfAccount: u32 = 524289;
274pub const sfOwner: u32 = 524290;
275pub const sfDestination: u32 = 524291;
276pub const sfIssuer: u32 = 524292;
277pub const sfAuthorize: u32 = 524293;
278pub const sfUnauthorize: u32 = 524294;
279pub const sfTarget: u32 = 524295;
280pub const sfRegularKey: u32 = 524296;
281pub const sfPaths: u32 = 1179649;
282pub const sfIndexes: u32 = 1245185;
283pub const sfHashes: u32 = 1245186;
284pub const sfAmendments: u32 = 1245187;
285pub const sfTransactionMetaData: u32 = 917506;
286pub const sfCreatedNode: u32 = 917507;
287pub const sfDeletedNode: u32 = 917508;
288pub const sfModifiedNode: u32 = 917509;
289pub const sfPreviousFields: u32 = 917510;
290pub const sfFinalFields: u32 = 917511;
291pub const sfNewFields: u32 = 917512;
292pub const sfTemplateEntry: u32 = 917513;
293pub const sfMemo: u32 = 917514;
294pub const sfSignerEntry: u32 = 917515;
295pub const sfEmitDetails: u32 = 917516;
296pub const sfSigner: u32 = 917520;
297pub const sfMajority: u32 = 917522;
298pub const sfNegativeUNLEntry: u32 = 917523;
299pub const sfSigningAccounts: u32 = 983042;
300pub const sfSigners: u32 = 983043;
301pub const sfSignerEntries: u32 = 983044;
302pub const sfTemplate: u32 = 983045;
303pub const sfNecessary: u32 = 983046;
304pub const sfSufficient: u32 = 983047;
305pub const sfAffectedNodes: u32 = 983048;
306pub const sfMemos: u32 = 983049;
307pub const sfMajorities: u32 = 983056;
308pub const sfNegativeUNL: u32 = 983057;
309pub const HOOKMACROS_INCLUDED: u32 = 1;
310pub const ttPAYMENT: u32 = 0;
311pub const tfCANONICAL: u32 = 2147483648;
312pub const atACCOUNT: u32 = 1;
313pub const atOWNER: u32 = 2;
314pub const atDESTINATION: u32 = 3;
315pub const atISSUER: u32 = 4;
316pub const atAUTHORIZE: u32 = 5;
317pub const atUNAUTHORIZE: u32 = 6;
318pub const atTARGET: u32 = 7;
319pub const atREGULARKEY: u32 = 8;
320pub const atPSEUDOCALLBACK: u32 = 9;
321pub const amAMOUNT: u32 = 1;
322pub const amBALANCE: u32 = 2;
323pub const amLIMITAMOUNT: u32 = 3;
324pub const amTAKERPAYS: u32 = 4;
325pub const amTAKERGETS: u32 = 5;
326pub const amLOWLIMIT: u32 = 6;
327pub const amHIGHLIMIT: u32 = 7;
328pub const amFEE: u32 = 8;
329pub const amSENDMAX: u32 = 9;
330pub const amDELIVERMIN: u32 = 10;
331pub const amMINIMUMOFFER: u32 = 16;
332pub const amRIPPLEESCROW: u32 = 17;
333pub const amDELIVEREDAMOUNT: u32 = 18;
334pub const ENCODE_TL_SIZE: u32 = 49;
335pub const ENCODE_DROPS_SIZE: u32 = 9;
336pub const ENCODE_TT_SIZE: u32 = 3;
337pub const ENCODE_ACCOUNT_SIZE: u32 = 22;
338pub const ENCODE_ACCOUNT_SRC_SIZE: u32 = 22;
339pub const ENCODE_ACCOUNT_DST_SIZE: u32 = 22;
340pub const ENCODE_UINT32_COMMON_SIZE: u32 = 5;
341pub const ENCODE_UINT32_UNCOMMON_SIZE: u32 = 6;
342pub const ENCODE_LLS_SIZE: u32 = 6;
343pub const ENCODE_FLS_SIZE: u32 = 6;
344pub const ENCODE_TAG_SRC_SIZE: u32 = 5;
345pub const ENCODE_TAG_DST_SIZE: u32 = 5;
346pub const ENCODE_SEQUENCE_SIZE: u32 = 5;
347pub const ENCODE_FLAGS_SIZE: u32 = 5;
348pub const ENCODE_SIGNING_PUBKEY_SIZE: u32 = 35;
349pub const ENCODE_SIGNING_PUBKEY_NULL_SIZE: u32 = 35;
350pub const PREPARE_PAYMENT_SIMPLE_SIZE: u32 = 237;
351pub const PREPARE_PAYMENT_SIMPLE_TRUSTLINE_SIZE: u32 = 277;
352extern "C" {
353 pub fn hook(reserved: i64) -> i64;
354}
355extern "C" {
356 pub fn cbak(reserved: i64) -> i64;
357}
358extern "C" {
359 #[doc = " Guard function. Each time a loop appears in your code a call to this must be the first branch instruction after the"]
360 #[doc = " beginning of the loop."]
361 #[doc = " @param id The identifier of the guard (typically the line number)."]
362 #[doc = " @param maxiter The maximum number of times this loop will iterate across the life of the hook."]
363 #[doc = " @return Can be ignored. If the guard is violated the hook will terminate."]
364 pub fn _g(id: u32, maxiter: u32) -> i32;
365}
366extern "C" {
367 #[doc = " Accept the originating transaction and commit all hook state changes and submit all emitted transactions."]
368 #[doc = " @param read_ptr An optional string to use as a return comment. May be 0."]
369 #[doc = " @param read_len The length of the string. May be 0."]
370 #[doc = " @return Will never return, terminates the hook."]
371 pub fn accept(read_ptr: u32, read_len: u32, error_code: i64) -> i64;
372}
373extern "C" {
374 #[doc = " Rollback the originating transaction, discard all hook state changes and emitted transactions."]
375 #[doc = " @param read_ptr An optional string to use as a return comment. May be 0."]
376 #[doc = " @param read_len The length of the string. May be 0."]
377 #[doc = " @return Will never return, terminates the hook."]
378 pub fn rollback(read_ptr: u32, read_len: u32, error_code: i64) -> i64;
379}
380extern "C" {
381 #[doc = " Read a 20 byte account-id from the memory pointed to by read_ptr of length read_len and encode it to a base58-check"]
382 #[doc = " encoded r-address."]
383 #[doc = " @param read_ptr The memory address of the account-id"]
384 #[doc = " @param read_len The byte length of the account-id (should always be 20)"]
385 #[doc = " @param write_ptr The memory address of a suitable buffer to write the encoded r-address into."]
386 #[doc = " @param write_len The size of the write buffer."]
387 #[doc = " @return On success the length of the r-address will be returned indicating the bytes written to the write buffer."]
388 #[doc = " On failure a negative integer is returned indicating what went wrong."]
389 pub fn util_raddr(write_ptr: u32, write_len: u32, read_ptr: u32, read_len: u32) -> i64;
390}
391extern "C" {
392 #[doc = " Read an r-address from the memory pointed to by read_ptr of length read_len and decode it to a 20 byte account id"]
393 #[doc = " and write to write_ptr"]
394 #[doc = " @param read_ptr The memory address of the r-address"]
395 #[doc = " @param read_len The byte length of the r-address"]
396 #[doc = " @param write_ptr The memory address of a suitable buffer to write the decoded account id into."]
397 #[doc = " @param write_len The size of the write buffer."]
398 #[doc = " @return On success 20 will be returned indicating the bytes written. On failure a negative integer is returned"]
399 #[doc = " indicating what went wrong."]
400 pub fn util_accid(write_ptr: u32, write_len: u32, read_ptr: u32, read_len: u32) -> i64;
401}
402extern "C" {
403 #[doc = " Verify a cryptographic signature either ED25519 of SECP256k1. Public key should be prefixed with 0xED for 25519."]
404 #[doc = " @param dread_ptr The memory location of the data or payload to verify"]
405 #[doc = " @param dread_len The length of the data or payload to verify"]
406 #[doc = " @param sread_ptr The memory location of the signature"]
407 #[doc = " @param sread_len The length of the signature"]
408 #[doc = " @param kread_ptr The memory location of the public key"]
409 #[doc = " @param kread_len The length of the public key"]
410 #[doc = " @return True if and only if the signature was verified."]
411 pub fn util_verify(
412 dread_ptr: u32,
413 dread_len: u32,
414 sread_ptr: u32,
415 sread_len: u32,
416 kread_ptr: u32,
417 kread_len: u32,
418 ) -> i64;
419}
420extern "C" {
421 #[doc = " Compute the first half of a SHA512 checksum."]
422 #[doc = " @param write_ptr The buffer to write the checksum into. Must be at least 32 bytes."]
423 #[doc = " @param write_len The length of the buffer."]
424 #[doc = " @param read_ptr The buffer to read data for digest from."]
425 #[doc = " @param read_len The amount of data to read from the buffer."]
426 #[doc = " @return The number of bytes written to write_ptr or a negative integer on error."]
427 pub fn util_sha512h(write_ptr: u32, write_len: u32, read_ptr: u32, read_len: u32) -> i64;
428}
429extern "C" {
430 #[doc = " Index into a xrpld serialized object and return the location and length of a subfield. Except for Array subtypes"]
431 #[doc = " the offset and length refer to the **payload** of the subfield not the entire subfield. Use SUB_OFFSET and"]
432 #[doc = " SUB_LENGTH macros to extract return value."]
433 #[doc = " @param read_ptr The memory location of the stobject"]
434 #[doc = " @param read_len The length of the stobject"]
435 #[doc = " @param field_id The Field Code of the subfield"]
436 #[doc = " @return high-word (most significant 4 bytes excluding the most significant bit (MSB)) is the field offset relative"]
437 #[doc = " to read_ptr and the low-word (least significant 4 bytes) is its length. MSB is sign bit, if set (negative)"]
438 #[doc = " return value indicates error (typically error means could not find.)"]
439 pub fn sto_subfield(read_ptr: u32, read_len: u32, field_id: u32) -> i64;
440}
441extern "C" {
442 #[doc = " Index into a xrpld serialized array and return the location and length of an index. Unlike sto_subfield this api"]
443 #[doc = " always returns the offset and length of the whole object at that index (not its payload.) Use SUB_OFFSET and"]
444 #[doc = " SUB_LENGTH macros to extract return value."]
445 #[doc = " @param read_ptr The memory location of the stobject"]
446 #[doc = " @param read_len The length of the stobject"]
447 #[doc = " @param array_id The index requested"]
448 #[doc = " @return high-word (most significant 4 bytes excluding the most significant bit (MSB)) is the field offset relative"]
449 #[doc = " to read_ptr and the low-word (least significant 4 bytes) is its length. MSB is sign bit, if set (negative)"]
450 #[doc = " return value indicates error (typically error means could not find.)"]
451 pub fn sto_subarray(read_ptr: u32, read_len: u32, array_id: u32) -> i64;
452}
453extern "C" {
454 pub fn sto_validate(read_ptr: u32, read_len: u32) -> i64;
455}
456extern "C" {
457 pub fn sto_emplace(
458 write_ptr: u32,
459 write_len: u32,
460 sread_ptr: u32,
461 sread_len: u32,
462 fread_ptr: u32,
463 fread_len: u32,
464 field_id: u32,
465 ) -> i64;
466}
467extern "C" {
468 pub fn sto_erase(
469 write_ptr: u32,
470 write_len: u32,
471 read_ptr: u32,
472 read_len: u32,
473 field_id: u32,
474 ) -> i64;
475}
476extern "C" {
477 pub fn util_keylet(
478 write_ptr: u32,
479 write_len: u32,
480 keylet_type: u32,
481 a: u32,
482 b: u32,
483 c: u32,
484 d: u32,
485 e: u32,
486 f: u32,
487 ) -> i64;
488}
489extern "C" {
490 #[doc = " Compute burden for an emitted transaction."]
491 #[doc = " @return the burden a theoretically emitted transaction would have."]
492 pub fn etxn_burden() -> i64;
493}
494extern "C" {
495 #[doc = " Write a full emit_details stobject into the buffer specified."]
496 #[doc = " @param write_ptr A sufficiently large buffer to write into."]
497 #[doc = " @param write_len The length of that buffer."]
498 #[doc = " @return The number of bytes written or a negative integer indicating an error."]
499 pub fn etxn_details(write_ptr: u32, write_len: u32) -> i64;
500}
501extern "C" {
502 #[doc = " Compute the minimum fee required to be paid by a hypothetically emitted transaction based on its size in bytes."]
503 #[doc = " @param The size of the emitted transaction in bytes"]
504 #[doc = " @return The minimum fee in drops this transaction should pay to succeed"]
505 pub fn etxn_fee_base(tx_byte_count: u32) -> i64;
506}
507extern "C" {
508 #[doc = " Inform xrpld that you will be emitting at most @count@ transactions during the course of this hook execution."]
509 #[doc = " @param count The number of transactions you intend to emit from this hook."]
510 #[doc = " @return If a negaitve integer an error has occured"]
511 pub fn etxn_reserve(count: u32) -> i64;
512}
513extern "C" {
514 #[doc = " Compute the generation of an emitted transaction. If this hook was invoked by a transaction emitted by a previous"]
515 #[doc = " hook then the generation counter will be 1+ the previous generation counter otherwise it will be 1."]
516 #[doc = " @return The generation of a hypothetically emitted transaction."]
517 pub fn etxn_generation() -> i64;
518}
519extern "C" {
520 #[doc = " Emit a transaction from this hook."]
521 #[doc = " @param read_ptr Memory location of a buffer containing the fully formed binary transaction to emit."]
522 #[doc = " @param read_len The length of the transaction."]
523 #[doc = " @return A negative integer if the emission failed."]
524 pub fn emit(write_ptr: u32, write_len: u32, read_ptr: u32, read_len: u32) -> i64;
525}
526extern "C" {
527 #[doc = " Retrieve the account the hook is running on."]
528 #[doc = " @param write_ptr A buffer of at least 20 bytes to write into."]
529 #[doc = " @param write_len The length of that buffer"]
530 #[doc = " @return The number of bytes written into the buffer of a negative integer if an error occured."]
531 pub fn hook_account(write_ptr: u32, write_len: u32) -> i64;
532}
533extern "C" {
534 #[doc = " Retrieve the hash of the currently executing hook."]
535 #[doc = " @param write_ptr A buffer of at least 32 bytes to write into."]
536 #[doc = " @param write_len The length of that buffer"]
537 #[doc = " @return The number of bytes written into the buffer of a negative integer if an error occured."]
538 pub fn hook_hash(write_ptr: u32, write_len: u32) -> i64;
539}
540extern "C" {
541 #[doc = " Retrive the currently recommended minimum fee for a transaction to succeed."]
542 pub fn fee_base() -> i64;
543}
544extern "C" {
545 #[doc = " Retrieve the current ledger sequence number"]
546 pub fn ledger_seq() -> i64;
547}
548extern "C" {
549 pub fn ledger_last_hash(write_ptr: u32, write_len: u32) -> i64;
550}
551extern "C" {
552 #[doc = " Retrieve a nonce for use in an emitted transaction (or another task). Can be called repeatedly for multiple nonces."]
553 #[doc = " @param write_ptr A buffer of at least 32 bytes to write into."]
554 #[doc = " @param write_len The length of that buffer"]
555 #[doc = " @return The number of bytes written into the buffer of a negative integer if an error occured."]
556 pub fn nonce(write_ptr: u32, write_len: u32) -> i64;
557}
558extern "C" {
559 #[doc = " Slot functions have not been implemented yet and the api for them is subject to change"]
560 pub fn slot(write_ptr: u32, write_len: u32, slot: u32) -> i64;
561}
562extern "C" {
563 pub fn slot_clear(slot: u32) -> i64;
564}
565extern "C" {
566 pub fn slot_count(slot: u32) -> i64;
567}
568extern "C" {
569 pub fn slot_id(slot: u32) -> i64;
570}
571extern "C" {
572 pub fn slot_set(read_ptr: u32, read_len: u32, slot: i32) -> i64;
573}
574extern "C" {
575 pub fn slot_size(slot: u32) -> i64;
576}
577extern "C" {
578 pub fn slot_subarray(parent_slot: u32, array_id: u32, new_slot: u32) -> i64;
579}
580extern "C" {
581 pub fn slot_subfield(parent_slot: u32, field_id: u32, new_slot: u32) -> i64;
582}
583extern "C" {
584 pub fn slot_type(slot: u32, flags: u32) -> i64;
585}
586extern "C" {
587 pub fn slot_float(slot: u32) -> i64;
588}
589extern "C" {
590 pub fn trace_slot(mread_ptr: u32, mread_len: u32, slot: u32) -> i64;
591}
592extern "C" {
593 pub fn otxn_slot(slot: u32) -> i64;
594}
595extern "C" {
596 #[doc = " In the hook's state key-value map, set the value for the key pointed at by kread_ptr."]
597 #[doc = " @param read_ptr A buffer containing the data to store"]
598 #[doc = " @param read_len The length of the data"]
599 #[doc = " @param kread_ptr A buffer containing the key"]
600 #[doc = " @param kread_len The length of the key"]
601 #[doc = " @return The number of bytes stored or a negative integer if an error occured"]
602 pub fn state_set(read_ptr: u32, read_len: u32, kread_ptr: u32, kread_len: u32) -> i64;
603}
604extern "C" {
605 #[doc = " Retrieve a value from the hook's key-value map."]
606 #[doc = " @param write_ptr A buffer to write the state value into"]
607 #[doc = " @param write_len The length of that buffer"]
608 #[doc = " @param kread_ptr A buffer to read the state key from"]
609 #[doc = " @param kread_len The length of that key"]
610 #[doc = " @return The number of bytes written or a negative integer if an error occured."]
611 pub fn state(write_ptr: u32, write_len: u32, kread_ptr: u32, kread_len: u32) -> i64;
612}
613extern "C" {
614 #[doc = " Retrieve a value from another hook's key-value map."]
615 #[doc = " @param write_ptr A buffer to write the state value into"]
616 #[doc = " @param write_len The length of that buffer"]
617 #[doc = " @param kread_ptr A buffer to read the state key from"]
618 #[doc = " @param kread_len The length of that key"]
619 #[doc = " @param aread_ptr A buffer containing an account-id of another account containing a hook whose state we are reading"]
620 #[doc = " @param aread_len The length of the account-id (should always be 20)."]
621 #[doc = " @return The number of bytes written or a negative integer if an error occured."]
622 pub fn state_foreign(
623 write_ptr: u32,
624 write_len: u32,
625 kread_ptr: u32,
626 kread_len: u32,
627 aread_ptr: u32,
628 aread_len: u32,
629 ) -> i64;
630}
631extern "C" {
632 #[doc = " Print some output to the trace log on xrpld. Any xrpld instance set to \"trace\" log level will see this."]
633 #[doc = " @param read_ptr A buffer containing either data or text (in either utf8, or utf16le)"]
634 #[doc = " @param read_len The byte length of the data/text to send to the trace log"]
635 #[doc = " @param as_hex If 0 treat the read_ptr as pointing at a string of text, otherwise treat it as data and print hex"]
636 #[doc = " @return The number of bytes output or a negative integer if an error occured."]
637 pub fn trace(
638 mread_ptr: u32,
639 mread_len: u32,
640 dread_ptr: u32,
641 dread_len: u32,
642 as_hex: u32,
643 ) -> i64;
644}
645extern "C" {
646 #[doc = " Print some output to the trace log on xrpld along with a decimal number. Any xrpld instance set to \"trace\" log"]
647 #[doc = " level will see this."]
648 #[doc = " @param read_ptr A pointer to the string to output"]
649 #[doc = " @param read_len The length of the string to output"]
650 #[doc = " @param number Any integer you wish to display after the text"]
651 #[doc = " @return A negative value on error"]
652 pub fn trace_num(read_ptr: u32, read_len: u32, number: i64) -> i64;
653}
654extern "C" {
655 #[doc = " Retrieve the burden of the originating transaction (if any)"]
656 #[doc = " @return The burden of the originating transaction"]
657 pub fn otxn_burden() -> i64;
658}
659extern "C" {
660 #[doc = " Retrieve a field from the originating transaction as \"full text\" (The way it is displayed in JSON)"]
661 #[doc = " @param write_ptr A buffer to write the representation into"]
662 #[doc = " @param write_len The length of the buffer"]
663 #[doc = " @param field_id The field code of the field being requested"]
664 #[doc = " @return The number of bytes written to write_ptr or a negative integer if an error occured."]
665 pub fn otxn_field_txt(write_ptr: u32, write_len: u32, field_id: u32) -> i64;
666}
667extern "C" {
668 #[doc = " Retrieve a field from the originating transaction in its raw serialized form."]
669 #[doc = " @param write_ptr A buffer to output the field into"]
670 #[doc = " @param write_len The length of the buffer."]
671 #[doc = " @param field_if The field code of the field being requested"]
672 #[doc = " @return The number of bytes written to write_ptr or a negative integer if an error occured."]
673 pub fn otxn_field(write_ptr: u32, write_len: u32, field_id: u32) -> i64;
674}
675extern "C" {
676 #[doc = " Retrieve the generation of the originating transaction (if any)."]
677 #[doc = " @return the generation of the originating transaction."]
678 pub fn otxn_generation() -> i64;
679}
680extern "C" {
681 #[doc = " Retrieve the TXNID of the originating transaction."]
682 #[doc = " @param write_ptr A buffer at least 32 bytes long"]
683 #[doc = " @param write_len The length of the buffer."]
684 #[doc = " @return The number of bytes written into the buffer or a negative integer on failure."]
685 pub fn otxn_id(write_ptr: u32, write_len: u32) -> i64;
686}
687extern "C" {
688 #[doc = " Retrieve the Transaction Type (e.g. ttPayment = 0) of the originating transaction."]
689 #[doc = " @return The Transaction Type (tt-code)"]
690 pub fn otxn_type() -> i64;
691}
692extern "C" {
693 pub fn float_set(exponent: i32, mantissa: i64) -> i64;
694}
695extern "C" {
696 pub fn float_multiply(float1: i64, float2: i64) -> i64;
697}
698extern "C" {
699 pub fn float_mulratio(float1: i64, round_up: u32, numerator: u32, denominator: u32) -> i64;
700}
701extern "C" {
702 pub fn float_negate(float1: i64) -> i64;
703}
704extern "C" {
705 pub fn float_compare(float1: i64, float2: i64, mode: u32) -> i64;
706}
707extern "C" {
708 pub fn float_sum(float1: i64, float2: i64) -> i64;
709}
710extern "C" {
711 pub fn float_sto(
712 write_ptr: u32,
713 write_len: u32,
714 cread_ptr: u32,
715 cread_len: u32,
716 iread_ptr: u32,
717 iread_len: u32,
718 float1: i64,
719 field_code: u32,
720 ) -> i64;
721}
722extern "C" {
723 pub fn float_sto_set(read_ptr: u32, read_len: u32) -> i64;
724}
725extern "C" {
726 pub fn float_invert(float1: i64) -> i64;
727}
728extern "C" {
729 pub fn float_divide(float1: i64, float2: i64) -> i64;
730}
731extern "C" {
732 pub fn float_one() -> i64;
733}
734extern "C" {
735 pub fn float_exponent(float1: i64) -> i64;
736}
737extern "C" {
738 pub fn float_exponent_set(float1: i64, exponent: i32) -> i64;
739}
740extern "C" {
741 pub fn float_mantissa(float1: i64) -> i64;
742}
743extern "C" {
744 pub fn float_mantissa_set(float1: i64, mantissa: i64) -> i64;
745}
746extern "C" {
747 pub fn float_sign(float1: i64) -> i64;
748}
749extern "C" {
750 pub fn float_sign_set(float1: i64, negative: u32) -> i64;
751}
752extern "C" {
753 pub fn float_int(float1: i64, decimal_places: u32, abs: u32) -> i64;
754}
755extern "C" {
756 pub fn trace_float(mread_ptr: u32, mread_len: u32, float1: i64) -> i64;
757}