1 /* Factor some of the duplication out of *.c. */
4 # define NULL_IF_DISCOVER_ONLY(val) NULL
6 # define NULL_IF_DISCOVER_ONLY(val) val
9 #define PT_define_limit_functions(PT_type) \
12 PT_type##_partition_check (const PedPartition *part) \
14 return ptt_partition_max_start_len (#PT_type, part); \
18 PT_type##_partition_max_start_sector (void) \
21 int err = ptt_partition_max_start_sector (#PT_type, &max); \
22 PED_ASSERT (err == 0); \
27 PT_type##_partition_max_length (void) \
30 int err = ptt_partition_max_length (#PT_type, &max); \
31 PED_ASSERT (err == 0); \
35 #define PT_op_function_initializers(PT_type) \
36 probe: PT_type##_probe, \
37 alloc: PT_type##_alloc, \
38 duplicate: PT_type##_duplicate, \
39 free: PT_type##_free, \
40 read: PT_type##_read, \
41 partition_new: PT_type##_partition_new, \
42 partition_duplicate: PT_type##_partition_duplicate, \
43 partition_set_flag: PT_type##_partition_set_flag, \
44 partition_get_flag: PT_type##_partition_get_flag, \
45 partition_set_system: PT_type##_partition_set_system, \
46 partition_is_flag_available: PT_type##_partition_is_flag_available, \
47 partition_align: PT_type##_partition_align, \
48 partition_destroy: PT_type##_partition_destroy, \
49 partition_enumerate: PT_type##_partition_enumerate, \
50 alloc_metadata: PT_type##_alloc_metadata, \
51 get_max_primary_partition_count: PT_type##_get_max_primary_partition_count, \
52 get_max_supported_partition_count:PT_type##_get_max_supported_partition_count,\
53 partition_check: PT_type##_partition_check, \
54 max_length: PT_type##_partition_max_length, \
55 max_start_sector: PT_type##_partition_max_start_sector