diff --git a/src/target/sparc64.c b/src/target/sparc64.c index 2bbf7bd..b1f5c40 100644 --- a/src/target/sparc64.c +++ b/src/target/sparc64.c @@ -16,7 +16,46 @@ +#include +#include #include "target.h" /* sparc64 */ +/* private */ +/* variables */ +As * as; + + +/* protected */ +/* prototypes */ +static int _sparc64_init(char const * arch, char const * format); +static int _sparc64_exit(void); + + +/* public */ +/* variables */ +TargetPlugin target_plugin = +{ + _sparc64_init, + _sparc64_exit +}; + + +/* protected */ +/* functions */ +/* sparc64_init */ +static int _sparc64_init(char const * arch, char const * format) +{ + if((as = as_new(arch, format)) == NULL) + return 1; + return 0; +} + + +/* sparc64_exit */ +static int _sparc64_exit(void) +{ + as_delete(as); + return 0; +} diff --git a/src/target/target.h b/src/target/target.h index 6e61698..1e016a5 100644 --- a/src/target/target.h +++ b/src/target/target.h @@ -22,6 +22,16 @@ /* Target */ /* protected */ +/* types */ typedef struct _Target Target; + +/* public */ +/* types */ +typedef struct _TargetPlugin +{ + int (*init)(char const *, char const *); + int (*exit)(void); +} TargetPlugin; + #endif /* !_C99_TARGET_TARGET_H */