Drop main() prototype. Syncs with NetBSD-8
[minix.git] / minix / lib / libmagicrt / include / st / metadata_transfer.h
blobe21e5b6b4540d55076ff50e972e9cbb1ac1e8700
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,
21 size_t *max_buff_sz);
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);
35 #else
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);
38 #endif
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) \
43 do { \
44 if (md_transfer_str(INFO, __UNCONST(STR_PT))) { \
45 printf("%s, line %d. md_transfer_str(): ERROR transferring.\n", \
46 __FILE__, __LINE__); \
47 return EGENERIC; \
48 } \
49 } while(0)
50 PRIVATE int md_transfer(st_init_info_t *info, void *from, void **to, int len);
51 #define MD_TRANSFER(INFO, FROM, TO, LEN) \
52 do { \
53 if (md_transfer(INFO, FROM, TO, LEN)) { \
54 printf("%s, line %d. md_transfer(): ERROR transferring.\n", \
55 __FILE__, __LINE__); \
56 return EGENERIC; \
57 } \
58 } while(0)
60 #endif /* METADATA_TRANSFER_H */