Any of the other line searches may serve as a guide to how this is to be done. There is also a basic template in the documentation for SNESLineSearchShellSetUserFunc().
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages