lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [lwip-users] CGI handler initialization


From: rocco brandi
Subject: Re: [lwip-users] CGI handler initialization
Date: Fri, 15 Jul 2011 15:22:03 +0100 (BST)

thanks Simon.

if I set:
const tCGI myCGI[]={{string, extract}};

http_set_cgi_handlers(myCGI,1);

the compiler warn:

error: syntax error before numeric constant
warning: type defaults to 'int' in declaration of 'http_set_cgi_handlers'
error: conflicting types for 'http_set_cgi_handlers'
error: previous declaration of 'http_set_cgi_handlers' was here
 warning: data definition has no type or storage class
warning: no newline at end of file

if I set:

const tCGI myCGI={string, extract};

http_set_cgi_handlers(&myCGI,1);

the complier:
error: syntax error before '&' token
warning: type defaults to 'int' in declaration of 'http_set_cgi_handlers'
error: conflicting types for 'http_set_cgi_handlers'
error: previous declaration of 'http_set_cgi_handlers' was here
warning: data definition has no type or storage class

by the way: is the type definition of my function "extract" correct?
I define it  const char *(extract)()

but in the definiton of the handler there is:
typedef const char *(*tCGIHandler)(int iIndex, int iNumParams, char *pcParam[],
                           char *pcValue[]);

should I set tCGIHandler *(extract)() ?


--- Ven 15/7/11, Simon Goldschmidt <address@hidden> ha scritto:

Da: Simon Goldschmidt <address@hidden>
Oggetto: Re: [lwip-users] CGI handler initialization
A: "Mailing list for lwIP users" <address@hidden>
Data: Venerdì 15 luglio 2011, 15:15


rocco brandi <address@hidden> wrote:
> const tCGI myCGI={string, extract};  //definition of my handler 
>  
> http_set_cgi_handlers(myCGI,1); // for now I have just one handler

That's clearly wrong: http_set_cgi_handlers() accepts a tCGI pointer, but you pass a value. You either need to change the call:

http_set_cgi_handlers(&myCGI,1);

or change the definition:

const tCGI myCGI[] = {{string, extract}};

Why did your compiler not warn when implicitly converting 'tCGI' to 'tCGI*'?

Simon
--
Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de

_______________________________________________
lwip-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/lwip-users

reply via email to

[Prev in Thread] Current Thread [Next in Thread]