added printer for .res files

This commit is contained in:
Nikita Smith
2025-02-01 23:50:30 -08:00
parent 0a0742aa0e
commit 76b83794b2
4 changed files with 83 additions and 1 deletions
+29
View File
@@ -214,6 +214,35 @@ coff_string_from_section_flags(Arena *arena, COFF_SectionFlags flags)
return result;
}
internal String8
coff_string_from_resource_memory_flags(Arena *arena, COFF_ResourceMemoryFlags flags)
{
Temp scratch = scratch_begin(&arena, 1);
String8List list = {0};
if (flags & COFF_ResourceMemoryFlag_Moveable) {
flags &= COFF_ResourceMemoryFlag_Moveable;
str8_list_pushf(scratch.arena, &list, "Moveable");
}
if (flags & COFF_ResourceMemoryFlag_Pure) {
flags &= COFF_ResourceMemoryFlag_Pure;
str8_list_pushf(scratch.arena, &list, "Pure");
}
if (flags & COFF_ResourceMemoryFlag_Discardable) {
flags &= COFF_ResourceMemoryFlag_Discardable;
str8_list_pushf(scratch.arena, &list, "Discardable");
}
if (flags != 0) {
str8_list_pushf(scratch.arena, &list, "%#x", flags);
}
String8 result = str8_list_join(arena, &list, &(StringJoin){.sep=str8_lit(", ")});
scratch_end(scratch);
return result;
}
internal String8
coff_string_from_import_header_type(COFF_ImportType type)
{
+1
View File
@@ -9,6 +9,7 @@ internal String8 coff_string_from_comdat_select_type(COFF_ComdatSelectType type)
internal String8 coff_string_from_machine_type(COFF_MachineType machine);
internal String8 coff_string_from_flags(Arena *arena, COFF_FileHeaderFlags flags);
internal String8 coff_string_from_section_flags(Arena *arena, COFF_SectionFlags flags);
internal String8 coff_string_from_resource_memory_flags(Arena *arena, COFF_ResourceMemoryFlags flags);
internal String8 coff_string_from_import_header_type(COFF_ImportType type);
internal String8 coff_string_from_sym_dtype(COFF_SymDType x);
internal String8 coff_string_from_sym_type(COFF_SymType x);