Sync return_data.inc and add a warning about modifying generated header files
This commit is contained in:
parent
07f41628db
commit
8bc8f77820
|
@ -16,6 +16,7 @@ extern "C" {
|
|||
* Prints the line number where the panic occurred and then causes
|
||||
* the BPF VM to immediately halt execution. No accounts' data are updated
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/assert.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
void sol_panic_(const char *, uint64_t, uint64_t, uint64_t);
|
||||
#else
|
||||
|
|
|
@ -21,6 +21,7 @@ extern "C" {
|
|||
* @param bytes_len Number of byte arrays
|
||||
* @param result 32 byte array to hold the result
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/blake3.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_blake3(const SolBytes *, int, const uint8_t *);
|
||||
#else
|
||||
|
|
|
@ -34,6 +34,7 @@ typedef struct {
|
|||
/**
|
||||
* Internal cross-program invocation function
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/cpi.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_invoke_signed_c(
|
||||
const SolInstruction *,
|
||||
|
|
|
@ -32,7 +32,7 @@ extern "C"
|
|||
* @param program_id the program_id which set the return data. Only set if there was some return data (the function returns non-zero).
|
||||
* @param result length of return data (may exceed bytes_len if the return data is longer)
|
||||
*/
|
||||
@SYSCALL uint64_t sol_get_return_data(const uint8_t *, uint64_t, SolPubkey *);
|
||||
@SYSCALL uint64_t sol_get_return_data(uint8_t *, uint64_t, SolPubkey *);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ extern "C" {
|
|||
* @param bytes_len Number of byte arrays
|
||||
* @param result 32 byte array to hold the result
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/keccak.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_keccak256(const SolBytes *, int, uint8_t *);
|
||||
#else
|
||||
|
|
|
@ -14,6 +14,7 @@ extern "C" {
|
|||
/**
|
||||
* Prints a string to stdout
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/log.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
void sol_log_(const char *, uint64_t);
|
||||
#else
|
||||
|
@ -28,6 +29,7 @@ static void sol_log_(const char * arg1, uint64_t arg2) {
|
|||
/**
|
||||
* Prints a 64 bit values represented in hexadecimal to stdout
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/log.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
void sol_log_64_(uint64_t, uint64_t, uint64_t, uint64_t, uint64_t);
|
||||
#else
|
||||
|
@ -42,6 +44,7 @@ static void sol_log_64_(uint64_t arg1, uint64_t arg2, uint64_t arg3, uint64_t ar
|
|||
/**
|
||||
* Prints the current compute unit consumption to stdout
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/log.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
void sol_log_compute_units_();
|
||||
#else
|
||||
|
@ -67,6 +70,7 @@ static void sol_log_array(const uint8_t *array, int len) {
|
|||
/**
|
||||
* Print the base64 representation of some arrays.
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/log.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
void sol_log_data(SolBytes *, uint64_t);
|
||||
#else
|
||||
|
|
|
@ -26,6 +26,7 @@ typedef struct {
|
|||
*
|
||||
* @param key The public key to print
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/pubkey.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
void sol_log_pubkey(const SolPubkey *);
|
||||
#else
|
||||
|
@ -77,6 +78,7 @@ typedef struct {
|
|||
* @param program_id Program id of the signer
|
||||
* @param program_address Program address created, filled on return
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/pubkey.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_create_program_address(const SolSignerSeed *, int, const SolPubkey *, SolPubkey *);
|
||||
#else
|
||||
|
@ -96,6 +98,7 @@ static uint64_t sol_create_program_address(const SolSignerSeed * arg1, int arg2,
|
|||
* @param program_address Program address created, filled on return
|
||||
* @param bump_seed Bump seed required to create a valid program address
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/pubkey.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_try_find_program_address(const SolSignerSeed *, int, const SolPubkey *, SolPubkey *, uint8_t *);
|
||||
#else
|
||||
|
|
|
@ -22,6 +22,7 @@ extern "C"
|
|||
* @param bytes byte array to set
|
||||
* @param bytes_len length of byte array. This may not exceed MAX_RETURN_DATA.
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/return_data.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
void sol_set_return_data(const uint8_t *, uint64_t);
|
||||
#else
|
||||
|
@ -40,6 +41,7 @@ static void sol_set_return_data(const uint8_t * arg1, uint64_t arg2) {
|
|||
* @param program_id the program_id which set the return data. Only set if there was some return data (the function returns non-zero).
|
||||
* @param result length of return data (may exceed bytes_len if the return data is longer)
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/return_data.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_get_return_data(uint8_t *, uint64_t, SolPubkey *);
|
||||
#else
|
||||
|
|
|
@ -32,6 +32,7 @@ extern "C" {
|
|||
* @param result 64 byte array to hold the result. A recovered public key
|
||||
* @return 0 if executed successfully
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/secp256k1.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_secp256k1_recover(const uint8_t *, uint64_t, const uint8_t *, uint8_t *);
|
||||
#else
|
||||
|
|
|
@ -21,6 +21,7 @@ extern "C" {
|
|||
* @param bytes_len Number of byte arrays
|
||||
* @param result 32 byte array to hold the result
|
||||
*/
|
||||
/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE sdk/bpf/c/inc/sol/inc/sha.inc AND RUN `cargo run --bin gen-headers` */
|
||||
#ifndef SOL_SBFV2
|
||||
uint64_t sol_sha256(const SolBytes *, int, uint8_t *);
|
||||
#else
|
||||
|
|
|
@ -85,6 +85,7 @@ fn transform(inc: &PathBuf) {
|
|||
let ty = &caps[1].to_string();
|
||||
let func = &caps[2].to_string();
|
||||
let args = &caps[3].to_string();
|
||||
let warn = format!("/* DO NOT MODIFY THIS GENERATED FILE. INSTEAD CHANGE {} AND RUN `cargo run --bin gen-headers` */", inc.display());
|
||||
let ifndef = format!("#ifndef SOL_SBFV2\n{} {}({});", ty, func, args);
|
||||
let hash = sys_hash(func);
|
||||
let typedef_statement = format!("typedef {}(*{}_pointer_type)({});", ty, func, args);
|
||||
|
@ -117,8 +118,8 @@ fn transform(inc: &PathBuf) {
|
|||
format!("return {}_pointer({});", func, arg_list)
|
||||
};
|
||||
format!(
|
||||
"{}\n#else\n{}\n{} {{\n {}\n {}\n}}\n#endif",
|
||||
ifndef, typedef_statement, function_signature, pointer_assignment, return_statement,
|
||||
"{}\n{}\n#else\n{}\n{} {{\n {}\n {}\n}}\n#endif",
|
||||
warn, ifndef, typedef_statement, function_signature, pointer_assignment, return_statement,
|
||||
)
|
||||
});
|
||||
write!(output_writer, "{}", output_content).unwrap();
|
||||
|
|
Loading…
Reference in New Issue