#ifndef OBJECTFILE_H_INCLUDED
#define OBJECTFILE_H_INCLUDED

#include <stdio.h>
#include "list.h"

/** Object file structure (forward declaration) */
struct s_objectFile;
typedef struct s_objectFile objectFile;

/** Creates a new object file and returns a pointer to it. */
extern objectFile* objectFileCreate(const char* name);

/** Collects all the sections from a objdump generated file. */
extern void objectFileCollect(objectFile* src, FILE* file);

/** Computes the dependencies between the various sections of the objects. */
extern void objectFileCompute(list* oFiles, FILE* file);

/** Recursively colorizes the dependency graph starting with seed.
    Two colors get mixed using non-exclusive OR. */
extern void objectFileColorize(const char* seed, unsigned long color);

/** Returns a list containing all used sections. */
extern list* objectFileGetUsed(objectFile* src);

/** Returns a list containing all unused sections. */
extern list* objectFileGetUnused(objectFile* src);

/** Returns the name of the given object file. */
extern const char* objectFileGetName(objectFile* src);

/** Dumps the dependency graph in XML format to stdout. */
extern void objectFileDumpMap(list* oFiles);

/** Dumps the used sections in XML format to stdout. */
extern void objectFileDumpUsed(list* oFiles);

/** Dumps the unused sections in XML format to stdout. */
extern void objectFileDumpUnused(list* oFiles);

#endif