Hi
Im working with the Zilog ez80 embedded webserver and have a problem.
The following is an extract from theez80 programmers reference manual:
-----------------------------------------------------------------------
The first parameter of the http_init function is http_defmethods, which is externally defined by eZ80 Webserver software. This parameter is a structure of the type http_method, which is found in the htp.h include file and shown as follows:
typedef struct http_method {
int key;
char *name;
void (*method)(Http_Request *);
} Http_Method;
The parameter is a set of structure entries that maps a request method to the requested method function. The user must, however, ensure that this parameter is included in the http_init call and that the htp.h include file (which contains a reference to the external definition http_defmethods) is included. This parameter contains a table of operations, or request methods, to be performed by Metro IPWorks™ on the document requested by the client browser.
The current default operations include the following:
• POST
• GET
• HEAD
These methods can be overridden by replacing a default with another entry, or more meth-ods
can be added by adding entries to this structure.
The default methods are shown as follows:
const Http_Method http_defmethods[] =
{
{HTTP_GET, "GET", http_get },
{HTTP_HEAD, "HEAD", http_get },
{HTTP_POST, "POST", http_post },
{0, NULL, NULL },
};
For example, the user could replace the http_get function with a user function called http_myget by changing the HTTP_GET entry as follows:
HTTP_GET, “GET”, http_myget
-----------------------------------------------------------------------
And what I want to do is to repplace the http_get function with another function. Should be no problem according to the text above.
But in the htp.h file it looks like this:
...
typedef struct http_method {
int key;
char *name;
void (*method)(Http_Request *);
} Http_Method;
extern const Http_Method http_defmethods[];
How can I replace the {HTTP_GET, "GET", http_get} line?
Have tried with exhanging the 'extern const Http_Method http_defmethods[];' line with:
const Http_Method http_defmethods[] =
{
{HTTP_GET, "GET", otherfunc },
{HTTP_HEAD, "HEAD", http_get },
{HTTP_POST, "POST", http_post },
{0, NULL, NULL },
};
Without sucess. Probably because the functions otherfunc, http_get ... are declared in another headerfile that includes htp.h it really confusing.
If u managed to get through all this text please help me out.
Im working with the Zilog ez80 embedded webserver and have a problem.
The following is an extract from theez80 programmers reference manual:
-----------------------------------------------------------------------
The first parameter of the http_init function is http_defmethods, which is externally defined by eZ80 Webserver software. This parameter is a structure of the type http_method, which is found in the htp.h include file and shown as follows:
typedef struct http_method {
int key;
char *name;
void (*method)(Http_Request *);
} Http_Method;
The parameter is a set of structure entries that maps a request method to the requested method function. The user must, however, ensure that this parameter is included in the http_init call and that the htp.h include file (which contains a reference to the external definition http_defmethods) is included. This parameter contains a table of operations, or request methods, to be performed by Metro IPWorks™ on the document requested by the client browser.
The current default operations include the following:
• POST
• GET
• HEAD
These methods can be overridden by replacing a default with another entry, or more meth-ods
can be added by adding entries to this structure.
The default methods are shown as follows:
const Http_Method http_defmethods[] =
{
{HTTP_GET, "GET", http_get },
{HTTP_HEAD, "HEAD", http_get },
{HTTP_POST, "POST", http_post },
{0, NULL, NULL },
};
For example, the user could replace the http_get function with a user function called http_myget by changing the HTTP_GET entry as follows:
HTTP_GET, “GET”, http_myget
-----------------------------------------------------------------------
And what I want to do is to repplace the http_get function with another function. Should be no problem according to the text above.
But in the htp.h file it looks like this:
...
typedef struct http_method {
int key;
char *name;
void (*method)(Http_Request *);
} Http_Method;
extern const Http_Method http_defmethods[];
How can I replace the {HTTP_GET, "GET", http_get} line?
Have tried with exhanging the 'extern const Http_Method http_defmethods[];' line with:
const Http_Method http_defmethods[] =
{
{HTTP_GET, "GET", otherfunc },
{HTTP_HEAD, "HEAD", http_get },
{HTTP_POST, "POST", http_post },
{0, NULL, NULL },
};
Without sucess. Probably because the functions otherfunc, http_get ... are declared in another headerfile that includes htp.h it really confusing.
If u managed to get through all this text please help me out.