summaryrefslogtreecommitdiff
path: root/src/linker.c
diff options
context:
space:
mode:
authorPixel <>2001-04-16 15:12:16 +0000
committerPixel <>2001-04-16 15:12:16 +0000
commite09044e963015cf672d0f992264ee1563717602a (patch)
tree1a55d7d5e46401a41ca7bc24e597d90b0b720601 /src/linker.c
parent3953a2906211a6c0007079dcafe66aa372ab33d1 (diff)
Indentation
Diffstat (limited to 'src/linker.c')
-rw-r--r--src/linker.c37
1 files changed, 22 insertions, 15 deletions
diff --git a/src/linker.c b/src/linker.c
index 61301de..ba1583c 100644
--- a/src/linker.c
+++ b/src/linker.c
@@ -6,56 +6,63 @@
#include "exceptions.h"
#include "linker.h"
-typedef void (*sighandler_t)(int);
+typedef void (*sighandler_t) (int);
-void invite(void) {
+void invite(void)
+{
fprintf(stderr, _("Linker v1.0\n\n"));
}
-void usage(void) {
+void usage(void)
+{
fprintf(stderr, _("Usage: linker obj1 [obj2 [obj3 [...]]] binary\n"));
exit(0);
}
-void init_all(int n) {
+void init_all(int n)
+{
fprintf(stderr, _(" o Initialising the linker... "));
init(n);
fprintf(stderr, _(" Done!\n"));
}
-void flush_all(void) {
+void flush_all(void)
+{
flush();
}
-void segfaulthand(int i) {
+void segfaulthand(int i)
+{
exception(1, _("Signal received: segfault"));
}
-int main(int argc, char ** argv) {
+int main(int argc, char **argv)
+{
int i;
invite();
-
+
signal(SIGSEGV, segfaulthand);
-
- if (argc < 3) usage();
+
+ if (argc < 3)
+ usage();
fprintf(stderr, _("\nPerforming initialisation...\n\n"));
init_all(argc - 2);
-
+
fprintf(stderr, _("Linking files...\n"));
-
+
for (i = 1; i < argc - 1; i++) {
addfile(argv[i]);
}
-
+
fprintf(stderr, _("Generating output file...\n"));
dumpfile(argv[i]);
fprintf(stderr, _("\nPerforming shutdown...\n\n"));
flush_all();
-
+
fprintf(stderr, _("Exitting, bye!\n"));
- return 0;
+ return 0;
}