Citation:
/*----------------------------------------------------------------------------
fonction : WMQ_MQConn
comment : Connexion à un queue manager
---------------------------------------------------------------------------- */
MQLONG WMQ_MQConn(tTransmission transmission,
MQHCONN &Hcon, MQHOBJ &Hobj, MQLONG &CReason)
{
MQLONG CompCode = 0;
// Declare MQI structures needed
MQCNO Connect_options = {MQCNO_DEFAULT}; // MQCONNX options
MQCD ClientConn = {MQCD_CLIENT_CONN_DEFAULT}; // Client connection channel
// definition
MQOD od = {MQOD_DEFAULT}; // Object Descriptor
char *p_argQMgrName = NULL; // q manager name
char *p_argConnName = NULL; // connection name
char *p_argChannelName = NULL; // channel name
MQCHAR QMName[MQ_Q_MGR_NAME_LENGTH];
// Initialisation du canal
strncpy(ClientConn.ConnectionName,
transmission.source.wmq.machine,
MQ_CONN_NAME_LENGTH);
strncpy(ClientConn.ChannelName,
transmission.source.wmq.canal,
MQ_CHANNEL_NAME_LENGTH);
strncpy(QMName, transmission.source.wmq.qManager, MQ_Q_MGR_NAME_LENGTH);
/* Point the MQCNO to the client connection definition */
Connect_options.ClientConnPtr = &ClientConn;
/* Client connection fields are in the version 2 part of the
MQCNO so we must set the version number to 2 or they will
be ignored */
Connect_options.Version = MQCNO_VERSION_2;
// Connexion au Queue Manager
MQCONNX(QMName, // queue manager
&Connect_options, // options for connection
&Hcon, // connection handle
&CompCode, // completion code
&CReason); // reason code
if (CompCode == MQCC_FAILED)
{
printf("MQCONNX ended with reason code %d\n", CReason);
exit( (int)CReason );
}
printf("MQCONNX\n");
return CompCode;
}
voici mes structures :
Citation:
struct tfile
{
char *filename;
};
struct twmq
{
char *machine;
char *canal;
char *queue;
char *qManager;
};
struct tSource{
char *connector;
struct twmq wmq;
struct tfile file;
};
struct tTarget{
char *type;
struct twmq wmq;
struct tfile file;
};
struct tTransmission{
char *id;
struct tSource source;
struct tSource target;
};
et voici l'erreur
Citation:
In file included from hosaflow.c:32:
wmq.h:5: error: parse error before "transmission"
wmq.h: In function `WMQ_MQConn':
wmq.h:26: error: `transmission' undeclared (first use in this function)
wmq.h:26: error: (Each undeclared identifier is reported only once
wmq.h:26: error: for each function it appears in.)
wmq.h:48: error: `Hcon' undeclared (first use in this function)
wmq.h:50: error: `CReason' undeclared (first use in this function)
wmq.h: At top level:
wmq.h:67: error: parse error before "transmission"
make: *** [hosaflow] Error 1