2 #define ushort unsigned short
8 asize -- determine object size
29 if ((f
= fopen(*++argv
, "r"))==NULL
) {
30 fprintf(stderr
, "asize: cannot open %s\n", *argv
);
33 getofmt ((char *)&buf
, SF_HEAD
, f
);
35 fprintf(stderr
, "asize: %s-- bad format\n", *argv
);
39 nrsect
= buf
.oh_nsect
;
41 fprintf(stderr
, "asize: %s-- no sections\n", *argv
);
46 printf("%s: ", *argv
);
49 while (nrsect
-- > 0) {
50 getofmt ((char *)&sbuf
, SF_SECT
, f
);
51 printf("%ld", sbuf
.os_size
);
56 printf(" = %ld = 0x%lx\n", sum
, sum
);
71 /* case '0': p++; continue; */
78 *((short *)p
) = i
; p
+= sizeof(short);
82 l
|= ((long)getc(f
) << 8);
83 l
|= ((long)getc(f
) << 16);
84 l
|= ((long)getc(f
) << 24);
85 *((long *)p
) = l
; p
+= sizeof(long);