Mercurial > hg-old > index.cgi
comparison src/output.c @ 305:10cc87f4b16c
Added basic raw output module
author | lost |
---|---|
date | Thu, 22 Jan 2009 02:14:52 +0000 |
parents | 13272197d278 |
children | 2b26edf2fe65 |
comparison
equal
deleted
inserted
replaced
304:9c6462b3a288 | 305:10cc87f4b16c |
---|---|
98 writebytes(buf, 1, 5, of); | 98 writebytes(buf, 1, 5, of); |
99 } | 99 } |
100 | 100 |
101 void do_output_raw(FILE *of) | 101 void do_output_raw(FILE *of) |
102 { | 102 { |
103 int nskips = 0; // used to output blanks for BSS inline | |
104 int sn; | |
105 | |
106 for (sn = 0; sn < nsects; sn++) | |
107 { | |
108 if (sectlist[sn].ptr -> flags & SECTION_BSS) | |
109 { | |
110 // no output for a BSS section | |
111 nskips += sectlist[sn].ptr -> codesize; | |
112 continue; | |
113 } | |
114 while (nskips > 0) | |
115 { | |
116 // the "" is not an error - it turns into a single NUL byte! | |
117 writebytes("", 1, 1, of); | |
118 nskips--; | |
119 } | |
120 writebytes(sectlist[sn].ptr -> code, 1, sectlist[sn].ptr -> codesize, of); | |
121 } | |
103 } | 122 } |