Lines Matching defs:macho
0 /* macho.c - load Mach-O files. */
25 #include <grub/macho.h>
26 #include <grub/cpu/macho.h>
33 grub_macho_close (grub_macho_t macho)
35 grub_file_t file = macho->file;
37 grub_free (macho->cmds32);
38 grub_free (macho->cmds64);
40 grub_free (macho);
51 grub_macho_t macho;
54 macho = grub_malloc (sizeof (*macho));
55 if (! macho)
58 macho->file = file;
59 macho->offset32 = -1;
60 macho->offset64 = -1;
61 macho->end32 = -1;
62 macho->end64 = -1;
63 macho->cmds32 = 0;
64 macho->cmds64 = 0;
66 if (grub_file_seek (macho->file, 0) == (grub_off_t) -1)
69 if (grub_file_read (macho->file, &filestart, sizeof (filestart))
85 if (grub_file_seek (macho->file, sizeof (struct grub_macho_fat_header))
91 if (grub_file_read (macho->file, archs,
106 macho->offset32 = grub_be_to_cpu32 (archs[i].offset);
107 macho->end32 = grub_be_to_cpu32 (archs[i].offset)
113 macho->offset64 = grub_be_to_cpu32 (archs[i].offset);
114 macho->end64 = grub_be_to_cpu32 (archs[i].offset)
124 macho->offset32 = 0;
125 macho->end32 = grub_file_size (file);
131 macho->offset64 = 0;
132 macho->end64 = grub_file_size (file);
135 grub_macho_parse32 (macho);
136 grub_macho_parse64 (macho);
138 return macho;
141 grub_macho_close (macho);
149 grub_macho_t macho;
155 macho = grub_macho_file (file);
156 if (! macho)
159 return macho;