* Emit the anchor for the specified field. If a field is the key for the * current request, the link changes its meaning to reverse the order when * selected again. Non-active fields always start in ascending order. */
| 1475 | * selected again. Non-active fields always start in ascending order. |
| 1476 | */ |
| 1477 | static void emit_link(request_rec *r, const char *anchor, char column, |
| 1478 | char curkey, char curdirection, |
| 1479 | const char *colargs, int nosort) |
| 1480 | { |
| 1481 | if (!nosort) { |
| 1482 | char qvalue[9]; |
| 1483 | |
| 1484 | qvalue[0] = '?'; |
| 1485 | qvalue[1] = 'C'; |
| 1486 | qvalue[2] = '='; |
| 1487 | qvalue[3] = column; |
| 1488 | qvalue[4] = ';'; |
| 1489 | qvalue[5] = 'O'; |
| 1490 | qvalue[6] = '='; |
| 1491 | /* reverse? */ |
| 1492 | qvalue[7] = ((curkey == column) && (curdirection == D_ASCENDING)) |
| 1493 | ? D_DESCENDING : D_ASCENDING; |
| 1494 | qvalue[8] = '\0'; |
| 1495 | ap_rvputs(r, "<a href=\"", qvalue, colargs ? colargs : "", |
| 1496 | "\">", anchor, "</a>", NULL); |
| 1497 | } |
| 1498 | else { |
| 1499 | ap_rputs(anchor, r); |
| 1500 | } |
| 1501 | } |
| 1502 | |
| 1503 | static void output_directories(struct ent **ar, int n, |
| 1504 | autoindex_config_rec *d, request_rec *r, |
no test coverage detected