#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include "pcioDrv.h"
Include dependency graph for ioscan.c:
Go to the source code of this file.
Defines | |
#define | MSG_LEN 40 |
#define | PAGE_SIZE 20 |
#define | LINE_SIZE 8 |
Functions | |
void | menu () |
void | printpage (int value) |
int | main (int argc, char *argv[]) |
Variables | |
int | pagesize = PAGE_SIZE |
int | linesize = LINE_SIZE |
int | line |
|
|
|
|
|
|
|
Definition at line 23 of file ioscan.c. Referenced by main().
00024 { 00025 printf("\n"); 00026 printf("# - prints page starting at i/o address #\n"); 00027 printf("p # - sets lines/page of i/o scan to #, default is 1 line/page\n"); 00028 printf(" - blank line prints next page\n"); 00029 printf("^C - get out of ioscan\n"); 00030 printf("\n"); 00031 } |
|
Definition at line 33 of file ioscan.c. Referenced by main().
|
|
Definition at line 50 of file ioscan.c. 00051 { 00052 char cmd[MSG_LEN]; 00053 00054 if(1 < argc) 00055 { 00056 sscanf(argv[1],"%x",&pagesize); 00057 printf("You have changed the page size to %x\n",pagesize); 00058 } 00059 00060 signal( SIGINT, exit ); 00061 00062 menu(); 00063 00064 while (1) 00065 { 00066 printf("io> "); 00067 fgets(cmd, MSG_LEN, stdin); 00068 00069 if('h' == *cmd) 00070 { 00071 menu(); 00072 } 00073 else if('p' == *cmd) 00074 { 00075 printf("Current page size is %d\n", pagesize); 00076 printf("Enter new page size in decimal "); 00077 printf("\n"); 00078 00079 fgets(cmd, MSG_LEN, stdin); 00080 if (1 != sscanf(cmd,"%d",&pagesize)) 00081 { 00082 printf("try again\n\n"); 00083 return; 00084 } 00085 00086 printf("New page size is %x\n", pagesize); 00087 00088 } 00089 else if('\n' == *cmd) 00090 printpage(line); 00091 else 00092 { /* assume it is a number, then print page starting at the number */ 00093 if (1 != sscanf(cmd,"%x",&line)) 00094 { 00095 printf("try again\n\n"); 00096 return; 00097 } 00098 printpage(line); 00099 } 00100 } 00101 } |
|
|
|
|
|
|