| 1153 | |
| 1154 | |
| 1155 | static void |
| 1156 | print_aligned_vertical_line(const printTextFormat *format, |
| 1157 | const unsigned short opt_border, |
| 1158 | unsigned long record, |
| 1159 | unsigned int hwidth, |
| 1160 | unsigned int dwidth, |
| 1161 | printTextRule pos, |
| 1162 | FILE *fout) |
| 1163 | { |
| 1164 | const printTextLineFormat *lformat = &format->lrule[pos]; |
| 1165 | unsigned int i; |
| 1166 | int reclen = 0; |
| 1167 | |
| 1168 | if (opt_border == 2) |
| 1169 | fprintf(fout, "%s%s", lformat->leftvrule, lformat->hrule); |
| 1170 | else if (opt_border == 1) |
| 1171 | fputs(lformat->hrule, fout); |
| 1172 | |
| 1173 | if (record) |
| 1174 | { |
| 1175 | if (opt_border == 0) |
| 1176 | reclen = fprintf(fout, "* Record %lu", record); |
| 1177 | else |
| 1178 | reclen = fprintf(fout, "[ RECORD %lu ]", record); |
| 1179 | } |
| 1180 | if (opt_border != 2) |
| 1181 | reclen++; |
| 1182 | if (reclen < 0) |
| 1183 | reclen = 0; |
| 1184 | for (i = reclen; i < hwidth; i++) |
| 1185 | fputs(opt_border > 0 ? lformat->hrule : " ", fout); |
| 1186 | reclen -= hwidth; |
| 1187 | |
| 1188 | if (opt_border > 0) |
| 1189 | { |
| 1190 | if (reclen-- <= 0) |
| 1191 | fputs(lformat->hrule, fout); |
| 1192 | if (reclen-- <= 0) |
| 1193 | fputs(lformat->midvrule, fout); |
| 1194 | if (reclen-- <= 0) |
| 1195 | fputs(lformat->hrule, fout); |
| 1196 | } |
| 1197 | else |
| 1198 | { |
| 1199 | if (reclen-- <= 0) |
| 1200 | fputc(' ', fout); |
| 1201 | } |
| 1202 | if (reclen < 0) |
| 1203 | reclen = 0; |
| 1204 | for (i = reclen; i < dwidth; i++) |
| 1205 | fputs(opt_border > 0 ? lformat->hrule : " ", fout); |
| 1206 | if (opt_border == 2) |
| 1207 | fprintf(fout, "%s%s", lformat->hrule, lformat->rightvrule); |
| 1208 | fputc('\n', fout); |
| 1209 | } |
| 1210 | |
| 1211 | static void |
| 1212 | print_aligned_vertical(const printTableContent *cont, |
no outgoing calls
no test coverage detected