bonjour,

Dans mon serveur Telnet/HTTP, je dois déclarer mes sockets comme ceci :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
sockets[] = {
	{TCP_PURPOSE_HTTP_SERVER, HTTP_TX_TCPBUFFERSIZE   , HTTP_RX_TCPBUFFERSIZE},
	{TCP_PURPOSE_TELNET,        , TELNET_TX_TCPBUFFERSIZE, TELNET_RX_TCPBUFFERSIZE}
};

Existe t-il une méthode pour dupliquer mes lignes en fonction d'un #define qui correspondrait au nombre de socket ?
Par exemple, si je déclare :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
#define HTTP_SOCKET_COUNT (2)
#define TELNET_SOCKET_COUNT (3)
Je voudrais que le tableau généré soit :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
sockets[] = {
	{TCP_PURPOSE_HTTP_SERVER, HTTP_TX_TCPBUFFERSIZE   , HTTP_RX_TCPBUFFERSIZE},
	{TCP_PURPOSE_HTTP_SERVER, HTTP_TX_TCPBUFFERSIZE   , HTTP_RX_TCPBUFFERSIZE},
	{TCP_PURPOSE_TELNET,        , TELNET_TX_TCPBUFFERSIZE, TELNET_RX_TCPBUFFERSIZE},
	{TCP_PURPOSE_TELNET,        , TELNET_TX_TCPBUFFERSIZE, TELNET_RX_TCPBUFFERSIZE},
	{TCP_PURPOSE_TELNET,        , TELNET_TX_TCPBUFFERSIZE, TELNET_RX_TCPBUFFERSIZE}
};
Merci d'avance