comparison lwlink/objdump.c @ 212:bae1e3ecdce1

More preparation for gnulib integration
author lost
date Fri, 24 Apr 2009 06:43:02 +0000
parents 048ebb85f6ef
children f9f01a499525
comparison
equal deleted inserted replaced
211:51511cf1c9f8 212:bae1e3ecdce1
19 19
20 20
21 A standalone program to dump an object file in a text form to stdout 21 A standalone program to dump an object file in a text form to stdout
22 22
23 */ 23 */
24 24 #include <config.h>
25 #include <stdio.h> 25 #include <stdio.h>
26 #include <stdlib.h> 26 #include <stdlib.h>
27 27
28 #include "util.h" 28 #include "util.h"
29 29
30 #ifdef HAVE_CONFIG_H 30 #ifdef HAVE_CONFIG_H
31 #include "config.h" 31 #include "config.h"
32 #endif 32 #endif
33 33
34 void read_lwobj16v0(unsigned char *filedata, long filesize); 34 void read_lwobj16v0(unsigned char *filedata, long filesize);
35 char *program_name;
35 36
36 /* 37 /*
37 The logic of reading the entire file into memory is simple. All the symbol 38 The logic of reading the entire file into memory is simple. All the symbol
38 names in the file are NUL terminated strings and can be used directly without 39 names in the file are NUL terminated strings and can be used directly without
39 making additional copies. 40 making additional copies.
43 int i; 44 int i;
44 long size; 45 long size;
45 FILE *f; 46 FILE *f;
46 long bread; 47 long bread;
47 unsigned char *filedata; 48 unsigned char *filedata;
48 49
50 program_name = argv[0];
49 if (argc != 2) 51 if (argc != 2)
50 { 52 {
51 fprintf(stderr, "Must specify exactly one input file.\n"); 53 fprintf(stderr, "Must specify exactly one input file.\n");
52 exit(1); 54 exit(1);
53 } 55 }