#ifndef WONKY_LINKAGE_H
#define WONKY_LINKAGE_H WONKY_LINKAGE_H
#include <linkage.hh>
#include <map.h>
#include <denoted.h>
#include <common.h>
#include <scope.h>
enum Linkage_Type;
/*this can be external or internal depending on which structure it is located*/
struct Linkage
{
/*
We push ASTs here ( object declarations and function declaration/definitions
The reason we push ASTs and not denoted objects is to check for reinitialisation
of objects or redefinition of functions
*/
struct Map *ids;
};
struct Linkage* get_linkage();
void delete_linkage();
/*These do not push to the linkage maps. They change linkage depending on the conditions*/
void resolve_object_linkage(struct Scope *scope,struct Translation_Data *translation_data,struct Denoted_Object *denoted_object);
void resolve_function_linkage(struct Scope *scope,struct Translation_Data *translation_data,struct Denoted_Function *denoted_function);
/*These push the declarations to the ids map*/
void push_object_into_linkage(struct Translation_Data *translation_data,struct AST_Object_Declaration *object);
void push_function_into_linkage(struct Translation_Data *translation_data,struct AST *function);
void push_function_definition_into_linkage(struct Translation_Data *translation_data,struct AST_Function_Definition *function);
void push_function_declaration_into_linkage(struct Translation_Data *translation_data,struct AST_Function_Declaration *function);
#endif