types.h 1.0 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

10 11
extern "C" {

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

struct uint256 {
   uint64_t words[4];
};
23

24 25 26 27 28
typedef uint64_t account_name;
typedef uint64_t permission_name;
typedef uint64_t token_name;
typedef uint64_t table_name;
typedef uint32_t time;
29 30 31
typedef uint64_t scope_name;
typedef uint64_t action_name;
typedef uint16_t region_id;
32

33 34
typedef uint64_t asset_symbol;
typedef int64_t share_type;
35

36 37
#define PACKED(X) __attribute((packed)) X

38
struct public_key {
39 40 41
   uint8_t data[33];
};

42
struct signature {
43 44 45
   uint8_t data[65];
};

46
struct checksum {
47 48 49
   uint64_t hash[4];
};

50
struct fixed_string16 {
51 52
   uint8_t len;
   char    str[16];
53 54
};

55
typedef fixed_string16 field_name;
56

57
struct fixed_string32 {
58 59
   uint8_t len;
   char    str[32];
60 61
};

62
typedef fixed_string32 type_name;
63

64 65 66 67
struct account_permission {
   account_name account;
   permission_name permission;
};
68

B
Bucky Kittinger 已提交
69
/// extern "C"
70
/// @}
B
Bucky Kittinger 已提交
71
}