SNMP Manager Programmer's Guide
Programming Examples
SNMP Manager Programmer’s Guide–134249
2-143
SNMPHOST Source Code
case 19: /* clock */
printf (" (clock device)");
break;
case 20: /* volatile memory */
printf (" (volatile memory device)");
break;
case 21: /* non-volatile memory */
printf (" (non-volatile memory device)");
break;
default:
break;
} /* switch */
printf ("\n");
lineCnt++;
if (!bBatchMode) { <--51
if ((lineCnt % nPageSize) == 0) {
printf (".....ENTER to continue.");
printf (" SPACE to stop.");
printf (" number (0..n) to jump....");
pptr = (char**)&line;
if (gets (line) != 0) {
if (line[0] == '\0')
i = i; /* continue */
else if (line[0] == ' ')
i = numEntries; /* force an exit of the loop */
else { /* assumed a number */
jumpIndex = strtol(line, pptr, 0);
if (*pptr == line) /* no conversion possible */
i = i; /* continue */
else { /* conversion sucessful */
if (jumpIndex < 0)
i = -1; /* start from the beginning */
else if (jumpIndex > numEntries) {
i = numEntries - 2; /* will go to the last */
lineCnt = nPageSize - 1; /* want prompt again */
}
Example 2-18. Contents of snmphosc (page 18 of 23)