Im trying to split my larger program into several modules. I know you need
to make the header file, and then include the header in both the main c file
and the file you made the header for. I can't get mine to quite work out
right.  I have tried changing the declarations in the header to extern,
removing the identifiers, and other things i cna think of, but i still get
errors.  I enclosed the header file, as well as the c file.  The way it
currently is, i get error messages looking for a ) in the declarations in
the header after the identifier, and that it is looking for an identifer
after the closing ) that already is there.  Any advice is greatly
appreciated.  Thanks
Andrew

(HEADER FILE)
#ifndef CHARS_H
#define CHARS_H
/////
// chars.h
/////

void send_char( Byte p );
Byte recv_char();

#endif

(C FILE)
/////
// chars.c
/////

#include "chars.h"

// void send_char( Byte p );
// Byte recv_char( );

void send_char( Byte p  )
{
 Err e;

 SerSend(SerialRefNum, &p, 1, &e );
 if( e )
  FrmCustomAlert( ErrorAlert, "Error", "", "" );
}

Byte recv_char( )
{
 Err e;
 Byte f;

 SerReceive(SerialRefNum,&f,1,0,&e);
 if( e )
  FrmCustomAlert( ErrorAlert, "Error", "", "" );

 return( f );
}

(MAIN.C)
#include <Pilot.h>
#include <Graffiti.h>
#include <SysEvtMgr.h>
#include <SerialMgr.h>
#include "Test_res.h"
#include "chars.h"
...



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to