Main Page   Class Hierarchy   Alphabetical List   Data Structures   File List   Data Fields   Globals  

ioscan.c File Reference

#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include "pcioDrv.h"

Include dependency graph for ioscan.c:

Include dependency graph

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


Define Documentation

#define MSG_LEN   40
 

Definition at line 15 of file ioscan.c.

#define PAGE_SIZE   20
 

Definition at line 16 of file ioscan.c.

#define LINE_SIZE   8
 

Definition at line 17 of file ioscan.c.


Function Documentation

void menu  
 

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 }

void printpage int    value
 

Definition at line 33 of file ioscan.c.

Referenced by main().

00034 {
00035   int i,j;
00036   for(i=value;i<value+(pagesize*linesize);i+=linesize)
00037   {
00038     printf("> %x : ", i);
00039     for(j=i;j<i+linesize;j++)
00040     {
00041       printf("%2x ", inputb(j));
00042       /*printf("%x ", j);*/
00043     }
00044     printf("\n");
00045   }
00046   line = i;
00047 }

int main int    argc,
char *    argv[]
 

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 }


Variable Documentation

int pagesize = PAGE_SIZE [static]
 

Definition at line 18 of file ioscan.c.

int linesize = LINE_SIZE [static]
 

Definition at line 19 of file ioscan.c.

int line [static]
 

Definition at line 20 of file ioscan.c.


Generated on Sun Dec 2 15:57:10 2001 for rcslib by doxygen1.2.11.1 written by Dimitri van Heesch, © 1997-2001