MCPcopy Create free account
hub / github.com/apache/httpd / emit_link

Function emit_link

modules/generators/mod_autoindex.c:1477–1501  ·  view source on GitHub ↗

* 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. */

Source from the content-addressed store, hash-verified

1475 * selected again. Non-active fields always start in ascending order.
1476 */
1477static 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
1503static void output_directories(struct ent **ar, int n,
1504 autoindex_config_rec *d, request_rec *r,

Callers 1

output_directoriesFunction · 0.85

Calls 2

ap_rvputsFunction · 0.85
ap_rputsFunction · 0.85

Tested by

no test coverage detected