166 } |
166 } |
167 |
167 |
168 // write line number |
168 // write line number |
169 if (showln) { |
169 if (showln) { |
170 WRITECONST(stream, out, "<span class=\"c2html-lineno\">"); |
170 WRITECONST(stream, out, "<span class=\"c2html-lineno\">"); |
171 char lnbuf[16]; |
171 char lnbuf[128]; |
172 int len = snprintf(lnbuf, 16, "%*d ", lnw, i+1); |
172 int len; |
|
173 // line number link |
|
174 len = snprintf(lnbuf, 128, "<a name=\"l%d\" href=\"#l%d\">", |
|
175 i+1, i+1); |
173 out(lnbuf, 1, len, stream); |
176 out(lnbuf, 1, len, stream); |
174 WRITECONST(stream, out, "</span> "); |
177 // justified line number |
|
178 len = snprintf(lnbuf, 128, "%*d ", lnw, i+1); |
|
179 out(lnbuf, 1, len, stream); |
|
180 WRITECONST(stream, out, "</a></span> "); |
175 } |
181 } |
176 |
182 |
177 // write formated (or plain) code line |
183 // write formated (or plain) code line |
178 out(ln, 1, strlen(ln), stream); |
184 out(ln, 1, strlen(ln), stream); |
179 } |
185 } |