@@ -122,12 +122,10 @@ pub struct blaze_normalize_opts {
122122 /// better choice.
123123 pub map_files : bool ,
124124 /// Normalize addresses inside APKs to the contained ELF file and
125- /// report a regular
126- /// [`BLAZE_USER_META_ELF`][blaze_user_meta_kind::BLAZE_USER_META_ELF]
127- /// meta data entry instead of an
128- /// [`BLAZE_USER_META_APK`][blaze_user_meta_kind::BLAZE_USER_META_APK]
129- /// one. As a result, the reported file offset will also be relative
130- /// to the contained ELF file and not to the APK itself.
125+ /// report a regular [`blaze_user_meta_kind::ELF`] meta data entry
126+ /// instead of an [`blaze_user_meta_kind::APK`] one. As a result,
127+ /// the reported file offset will also be relative to the contained
128+ /// ELF file and not to the APK itself.
131129 pub apk_to_elf : bool ,
132130 /// Unused member available for future expansion. Must be initialized
133131 /// to zero.
@@ -281,10 +279,21 @@ pub struct blaze_user_meta_kind(u8);
281279
282280impl blaze_user_meta_kind {
283281 /// [`blaze_user_meta_variant::unknown`] is valid.
284- pub const BLAZE_USER_META_UNKNOWN : blaze_user_meta_kind = blaze_user_meta_kind ( 0 ) ;
282+ pub const UNKNOWN : blaze_user_meta_kind = blaze_user_meta_kind ( 0 ) ;
285283 /// [`blaze_user_meta_variant::apk`] is valid.
286- pub const BLAZE_USER_META_APK : blaze_user_meta_kind = blaze_user_meta_kind ( 1 ) ;
284+ pub const APK : blaze_user_meta_kind = blaze_user_meta_kind ( 1 ) ;
287285 /// [`blaze_user_meta_variant::elf`] is valid.
286+ pub const ELF : blaze_user_meta_kind = blaze_user_meta_kind ( 2 ) ;
287+
288+ // TODO: Remove the following constants with the 0.2 release
289+ /// Deprecated; use `BLAZE_USER_META_KIND_UNKNOWN`.
290+ #[ deprecated]
291+ pub const BLAZE_USER_META_UNKNOWN : blaze_user_meta_kind = blaze_user_meta_kind ( 0 ) ;
292+ /// Deprecated; use `BLAZE_USER_META_KIND_APK`.
293+ #[ deprecated]
294+ pub const BLAZE_USER_META_APK : blaze_user_meta_kind = blaze_user_meta_kind ( 1 ) ;
295+ /// Deprecated; use `BLAZE_USER_META_KIND_ELF`.
296+ #[ deprecated]
288297 pub const BLAZE_USER_META_ELF : blaze_user_meta_kind = blaze_user_meta_kind ( 2 ) ;
289298}
290299
@@ -491,11 +500,11 @@ impl blaze_user_meta_unknown {
491500/// The actual variant data in [`blaze_user_meta`].
492501#[ repr( C ) ]
493502pub union blaze_user_meta_variant {
494- /// Valid on [`blaze_user_meta_kind::BLAZE_USER_META_APK `].
503+ /// Valid on [`blaze_user_meta_kind::APK `].
495504 pub apk : ManuallyDrop < blaze_user_meta_apk > ,
496- /// Valid on [`blaze_user_meta_kind::BLAZE_USER_META_ELF `].
505+ /// Valid on [`blaze_user_meta_kind::ELF `].
497506 pub elf : ManuallyDrop < blaze_user_meta_elf > ,
498- /// Valid on [`blaze_user_meta_kind::BLAZE_USER_META_UNKNOWN `].
507+ /// Valid on [`blaze_user_meta_kind::UNKNOWN `].
499508 pub unknown : ManuallyDrop < blaze_user_meta_unknown > ,
500509}
501510
@@ -525,23 +534,23 @@ impl blaze_user_meta {
525534 fn from ( other : UserMeta ) -> ManuallyDrop < Self > {
526535 let slf = match other {
527536 UserMeta :: Apk ( apk) => Self {
528- kind : blaze_user_meta_kind:: BLAZE_USER_META_APK ,
537+ kind : blaze_user_meta_kind:: APK ,
529538 unused : [ 0 ; 7 ] ,
530539 variant : blaze_user_meta_variant {
531540 apk : blaze_user_meta_apk:: from ( apk) ,
532541 } ,
533542 reserved : [ 0 ; 16 ] ,
534543 } ,
535544 UserMeta :: Elf ( elf) => Self {
536- kind : blaze_user_meta_kind:: BLAZE_USER_META_ELF ,
545+ kind : blaze_user_meta_kind:: ELF ,
537546 unused : [ 0 ; 7 ] ,
538547 variant : blaze_user_meta_variant {
539548 elf : blaze_user_meta_elf:: from ( elf) ,
540549 } ,
541550 reserved : [ 0 ; 16 ] ,
542551 } ,
543552 UserMeta :: Unknown ( unknown) => Self {
544- kind : blaze_user_meta_kind:: BLAZE_USER_META_UNKNOWN ,
553+ kind : blaze_user_meta_kind:: UNKNOWN ,
545554 unused : [ 0 ; 7 ] ,
546555 variant : blaze_user_meta_variant {
547556 unknown : blaze_user_meta_unknown:: from ( unknown) ,
@@ -555,13 +564,13 @@ impl blaze_user_meta {
555564
556565 unsafe fn free ( self ) {
557566 match self . kind {
558- blaze_user_meta_kind:: BLAZE_USER_META_APK => unsafe {
567+ blaze_user_meta_kind:: APK => unsafe {
559568 ManuallyDrop :: into_inner ( self . variant . apk ) . free ( )
560569 } ,
561- blaze_user_meta_kind:: BLAZE_USER_META_ELF => unsafe {
570+ blaze_user_meta_kind:: ELF => unsafe {
562571 ManuallyDrop :: into_inner ( self . variant . elf ) . free ( )
563572 } ,
564- blaze_user_meta_kind:: BLAZE_USER_META_UNKNOWN => {
573+ blaze_user_meta_kind:: UNKNOWN => {
565574 ManuallyDrop :: into_inner ( unsafe { self . variant . unknown } ) . free ( )
566575 }
567576 _ => {
@@ -808,7 +817,7 @@ mod tests {
808817 "blaze_normalized_output { output: 4919, meta_idx: 1, reserved: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] }"
809818 ) ;
810819
811- let meta_kind = blaze_user_meta_kind:: BLAZE_USER_META_APK ;
820+ let meta_kind = blaze_user_meta_kind:: APK ;
812821 assert_eq ! ( format!( "{meta_kind:?}" ) , "blaze_user_meta_kind(1)" ) ;
813822
814823 let apk = blaze_user_meta_apk {
@@ -841,7 +850,7 @@ mod tests {
841850 ) ;
842851
843852 let meta = blaze_user_meta {
844- kind : blaze_user_meta_kind:: BLAZE_USER_META_UNKNOWN ,
853+ kind : blaze_user_meta_kind:: UNKNOWN ,
845854 unused : [ 0 ; 7 ] ,
846855 variant : blaze_user_meta_variant {
847856 unknown : ManuallyDrop :: new ( blaze_user_meta_unknown {
@@ -976,7 +985,7 @@ mod tests {
976985 assert_eq ! ( user_addrs. output_cnt, 6 ) ;
977986
978987 let meta = unsafe { user_addrs. metas . read ( ) } ;
979- assert_eq ! ( meta. kind, blaze_user_meta_kind:: BLAZE_USER_META_UNKNOWN ) ;
988+ assert_eq ! ( meta. kind, blaze_user_meta_kind:: UNKNOWN ) ;
980989 assert_eq ! (
981990 unsafe { meta. variant. unknown. reason } ,
982991 blaze_normalize_reason:: UNMAPPED
@@ -1144,7 +1153,7 @@ mod tests {
11441153
11451154 let output = unsafe { & * normalized. outputs . add ( 0 ) } ;
11461155 let meta = unsafe { & * normalized. metas . add ( output. meta_idx ) } ;
1147- assert_eq ! ( meta. kind, blaze_user_meta_kind:: BLAZE_USER_META_ELF ) ;
1156+ assert_eq ! ( meta. kind, blaze_user_meta_kind:: ELF ) ;
11481157
11491158 let elf = unsafe { & meta. variant . elf } ;
11501159
@@ -1218,7 +1227,7 @@ mod tests {
12181227
12191228 let output = unsafe { & * normalized. outputs . add ( 0 ) } ;
12201229 let meta = unsafe { & * normalized. metas . add ( output. meta_idx ) } ;
1221- assert_eq ! ( meta. kind, blaze_user_meta_kind:: BLAZE_USER_META_ELF ) ;
1230+ assert_eq ! ( meta. kind, blaze_user_meta_kind:: ELF ) ;
12221231
12231232 let elf = unsafe { & meta. variant . elf } ;
12241233 let path = unsafe { CStr :: from_ptr ( elf. path ) } ;
0 commit comments