home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 3 Comm
/
03-Comm.zip
/
DMP_FON.ZIP
/
DMP_FON.C
next >
Wrap
Text File
|
1990-10-09
|
2KB
|
76 lines
/*
* This program dumps out the dialing directory for PMCOMM 1.06. It isn't
* very smart, but it met my poor needs of a quick printout. Feel free to
* modify it as you please. It prints to stdout, so you can redirect the
* output to a file, or the printer.
*
* Note: This is not an officially supported product by anyone. I wrote it
* without input or assistance from Multi-Net so don't be upset if it doesn't
* work with any version of PMCOMM other than 1.06. On the other hand, it
* won't hurt to try it.
*
* Kevin Nickerson
*
*/
#include <stdio.h>
#include <stdlib.h>
#define PHONE_FILE "pmcomm.fon"
/* This structure was determined by looking at the dialing directory in hex.
The filler area was stuff that I wasn't concerned about. */
struct t_entry
{
char name [21];
char number [21];
char baud [7];
char parity [5];
char data_bits [2];
char stop_bits [2];
char script [12];
char filler [52];
};
void print_entry ( struct t_entry * );
void main ( void )
{
struct t_entry entry;
FILE *fp;
if ( NULL == (fp = fopen ( PHONE_FILE, "rb" )) )
{
perror ( PHONE_FILE );
exit ( 1 );
}
do
{
if ( 1 == fread ( &entry, sizeof ( entry ), 1, fp ) )
print_entry ( &entry );
}
while ( ! feof ( fp ) );
fclose ( fp );
exit ( 0 );
}
void print_entry
(
struct t_entry *entry
)
{
printf ( "%-20s %-20s %7s %s-%c-%s %-12s\n",
entry -> name,
entry -> number,
entry -> baud,
entry -> data_bits,
entry -> parity [0],
entry -> stop_bits,
entry -> script );
}