script.h (1025B)
1 2 #ifndef BTCS_SCRIPT_H 3 #define BTCS_SCRIPT_H 4 5 #include "stack.h" 6 #include "op.h" 7 8 struct result { 9 char * error; 10 enum opcode last_op; 11 int op_count; 12 }; 13 14 int script_eval(const u8 *script, size_t script_size, struct stack *stack, 15 struct result *result); 16 void script_print_ops(char * buf, size_t size); 17 void script_print_vals(struct stack *); 18 void script_push_int(struct stack *, s64); 19 20 void script_push_str(struct stack *script, const char *str); 21 void script_push_raw(struct stack *, const char *str); 22 void script_push_datastr(struct stack *, const char *str, int israw); 23 24 void script_serialize(struct stack *stack, u8 *buf, int buflen, int* len); 25 void stack_serialize(struct stack *stack, u8 *buf, int buflen, int* len); 26 27 void script_print(const u8 *script, size_t script_size, int abbrev_data); 28 int script_getop(const u8 **p, const u8 *end, enum opcode *popcode, u8 *buf, int bufsize, u32 *outlen); 29 30 extern int g_silence_script_err; 31 extern int g_silence_script_warn; 32 33 #endif /* BTCS_SCRIPT_H */