SNMP Subagent Programmer's Guide

Writing Subagent Logic
SNMP Subagent Programmer’s Guide—119728 4-37
Callback Functions
if (*indices == NULL)
{
file = dir->files; /* get first one */
}
else
{
DisplayString *name = (DisplayString *)indices[0];
for (file = dir->files; file; file = file->next)
{
if (comp_files(name, &file->file_name) < 0)
{
break;
}
}
}
if (file)
{
/* Overwrite the array of pointers that
* was passed in with pointers to the "next"
* set of indices. */
indices[0] = (Void *) &file->file_name;
return(0); /* success */
}
return(ENOENT);
}