1 #ifndef METADATA_TRANSFER_H
2 #define METADATA_TRANSFER_H
4 #include <st/state_transfer.h>
6 /* Metadata transfer and adjustment functions */
7 PRIVATE
int transfer_metadata_functions(st_init_info_t
*info
,
8 struct _magic_vars_t
*cached_magic_vars
,
9 struct _magic_vars_t
*remote_magic_vars
,
10 st_counterparts_t
*counterparts
);
11 PRIVATE
int transfer_metadata_dfunctions(st_init_info_t
*info
,
12 struct _magic_vars_t
*cached_magic_vars
,
13 struct _magic_vars_t
*remote_magic_vars
,
14 st_counterparts_t
*counterparts
);
15 PRIVATE
int transfer_metadata_type_members(st_init_info_t
*info
,
16 struct _magic_type
*type
, struct _magic_vars_t
*cached_magic_vars
,
17 struct _magic_vars_t
*remote_magic_vars
);
18 PRIVATE
int transfer_metadata_sentries(st_init_info_t
*info
,
19 struct _magic_vars_t
*cached_magic_vars
,
20 struct _magic_vars_t
*remote_magic_vars
, st_counterparts_t
*counterparts
,
22 PRIVATE
int transfer_metadata_sentry_members(st_init_info_t
*info
,
23 struct _magic_sentry
*sentry
);
25 PRIVATE
int pair_metadata_types(st_init_info_t
*info
,
26 struct _magic_vars_t
*cached_magic_vars
,
27 st_counterparts_t
*counterparts
, int allow_unpaired_types
);
28 PRIVATE
int pair_metadata_functions(st_init_info_t
*info
,
29 struct _magic_vars_t
*cached_magic_vars
, st_counterparts_t
*counterparts
);
30 PRIVATE
int pair_metadata_sentries(st_init_info_t
*info
,
31 struct _magic_vars_t
*cached_magic_vars
, st_counterparts_t
*counterparts
);
32 #if !ST_ASSUME_RAW_COPY_BEFORE_TRANSFER
33 PRIVATE
int allocate_pair_metadata_dsentries(st_init_info_t
*info
,
34 struct _magic_vars_t
*cached_magic_vars
, st_counterparts_t
*counterparts
);
36 PRIVATE
int allocate_pair_metadata_dsentries_from_raw_copy(st_init_info_t
*info
,
37 struct _magic_vars_t
*cached_magic_vars
, st_counterparts_t
*counterparts
);
40 /* metadata transfer helper functions */
41 PRIVATE
int md_transfer_str(st_init_info_t
*info
, char **str_pt
);
42 #define MD_TRANSFER_STR(INFO, STR_PT) \
44 if (md_transfer_str(INFO, __UNCONST(STR_PT))) { \
45 printf("%s, line %d. md_transfer_str(): ERROR transferring.\n", \
46 __FILE__, __LINE__); \
50 PRIVATE
int md_transfer(st_init_info_t
*info
, void *from
, void **to
, int len
);
51 #define MD_TRANSFER(INFO, FROM, TO, LEN) \
53 if (md_transfer(INFO, FROM, TO, LEN)) { \
54 printf("%s, line %d. md_transfer(): ERROR transferring.\n", \
55 __FILE__, __LINE__); \
60 #endif /* METADATA_TRANSFER_H */