types.h 1.1 KB
Newer Older
1 2 3 4
/**
 *  @file
 *  @copyright defined in eos/LICENSE.txt
 */
5 6
#pragma once

7
#include <stdint.h>
8
#include <wchar.h>
9

B
Bart Wyatt 已提交
10
#ifdef __cplusplus
11
extern "C" {
B
Bart Wyatt 已提交
12
#endif
13

14 15 16
/**
 *  @defgroup types Builtin Types
 *  @ingroup contractdev
17 18 19
 *  @brief Specifies typedefs and aliases
 *
 *  @{
20
 */
21

22 23 24 25 26 27 28 29 30
typedef uint64_t account_name;
typedef uint64_t permission_name;
typedef uint64_t table_name;
typedef uint32_t time;
typedef uint64_t scope_name;
typedef uint64_t action_name;

typedef int64_t share_type;
typedef uint16_t weight_type;
31

32
/* macro to align/overalign a type to ensure calls to intrinsics with pointers/references are properly aligned */
33
#define ALIGNED(X) __attribute__ ((aligned (16))) X
34

35
struct public_key {
B
Bucky Kittinger 已提交
36
   char data[34];
37 38
};

39
struct signature {
B
Bucky Kittinger 已提交
40
   uint8_t data[66];
41 42
};

B
Bucky Kittinger 已提交
43
struct ALIGNED(checksum256) {
44 45 46
   uint8_t hash[32];
};

B
Bucky Kittinger 已提交
47
struct ALIGNED(checksum160) {
48 49 50
   uint8_t hash[20];
};

B
Bucky Kittinger 已提交
51
struct ALIGNED(checksum512) {
52 53
   uint8_t hash[64];
};
54

B
Bucky Kittinger 已提交
55
typedef struct checksum256 transaction_id_type;
56
typedef struct checksum256 block_id_type;
57

58 59 60 61
struct account_permission {
   account_name account;
   permission_name permission;
};
62

B
Bart Wyatt 已提交
63
#ifdef __cplusplus
64
} /// extern "C"
B
Bart Wyatt 已提交
65
#endif
66
/// @}