I'm still a bit of a C newbie, so there might be a few beginner mistakes.
When I try to compile my smtp.c file, it gives me these errors:
Code:
In file included from smtp.c:3:
/home/dominique/smtp/smtp.h:11: error: expected ‘)’ before ‘*’ token
/home/dominique/smtp/smtp.h:12: error: expected ‘;’ before ‘void’
smtp.c: In function ‘main’:
smtp.c:82: error: redefinition of ‘l_psmtpClient’
smtp.c:9: error: previous definition of ‘l_psmtpClient’ was here
smtp.c:141: error: redefinition of ‘l_psmtpClient’
smtp.c:82: error: previous definition of ‘l_psmtpClient’ was here
The error about the header file really puzzles me, because I don't see anything wrong with the syntax in smtp.h:
Code:
// smtp.h
#define NSMAIL_OK 0
int l_retCode;
typedef struct smtpClient smtpClient_t;
typedef struct smtpSink
{
void * pOpaqueData;
void (*bdat)(smtpSink_t * in_psmtpSink, int in_responseCode, const char * in_responseMessage) ;
void (*connect)( smtpSink_t * in_psmtpSink, int in_responseCode, const char * in_responseMessage ) ;
void (*data)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*ehlo)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_serverExtension );
void (*ehloComplete)(smtpSink_t * in_psmtpSink );
void (*expand)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_emailAddress );
void (*error)( SMTPSinkPtr_t in_psmtpSink,
int in_responseCode,
const char * in_errorMessage );
void (*expand)( SMTPSinkPtr_t in_psmtpSink,
int in_responseCode,
const char * in_emailAddress );
void (*expandComplete)(smtpSink_t * in_psmtpSink);
void (*help)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_helpMessage );
void (*helpComplete)(smtpSink_t * in_psmtpSink );
void (*mailFrom)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*noop)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*quit)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*rcptTo)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*reset)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*send)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*sendCommand)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
void (*sendCommandComplete)(smtpSink_t *
in_psmtpSink );
void (*verify)( smtpSink_t * in_psmtpSink,
int in_responseCode,
const char * in_responseMessage );
}smtpSink_t;
Could anyone point out what I'm doing wrong?
Thanks for your help, in advance.