Advertisement
1WaKa_WaKa1

LLP

Oct 11th, 2022 (edited)
220
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.24 KB | None | 0 0
  1. #ifndef __STRUCTS__
  2. #define __STRUCTS__
  3.  
  4. #include <stdbool.h>
  5. #include <stddef.h>
  6. #include <stdint.h>
  7.  
  8. struct node {
  9.     uint32_t id;
  10.     uint32_t next_rel_id;
  11.     uint32_t next_prop_id;
  12. };
  13.  
  14. struct relationship {
  15.     uint32_t id;
  16.     uint32_t first_node_id;
  17.     uint32_t second_node_id;
  18.     uint16_t type;
  19.     uint32_t next_prop_id;
  20.     uint32_t prev_rel_id;
  21.     uint32_t next_rel_id;
  22. };
  23.  
  24. struct property {
  25.     uint32_t id;
  26.     uint32_t prev_prop_id;
  27.     uint32_t next_prop_id;
  28.     bool is_props_data_string;
  29.     union props_block{
  30.         int props_block1;
  31.         int props_block2;
  32.         float props_block3;
  33.         bool props_block4;
  34.     };
  35.  
  36. };
  37.  
  38. struct string_bucket {
  39.     uint16_t length;
  40.     char *data_start;
  41. };
  42.  
  43. struct block_info {
  44.     uint16_t type; // 1 node, 2 - relation, 3 - props
  45.     size_t tuple_address;
  46.     size_t next_block_address;
  47. };
  48.  
  49. struct page_header {
  50.     size_t next_page_address;
  51.     size_t first_node_info_address;
  52.     size_t first_rel_info_address;
  53.     size_t first_prop_info_address;
  54. };
  55.  
  56. struct page {
  57.     page_header page_header;
  58.     size_t prev_page_address;
  59.     size_t next_page_address;
  60. };
  61.  
  62. struct file_header {
  63.     int page_amount;
  64.     size_t first_page_address;
  65. };
  66.  
  67. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement