Function get_nth_item:
Defined in module history (file: /obj/secure/shell/history.c)

returns the nth command if it's still in the history buffer.

Prototype:
get_nth_item(int n);
