taskrambler  0.1.9
Web server and task management solution.
get_method_id.c File Reference
#include <string.h>
#include "http/request.h"
+ Include dependency graph for get_method_id.c:

Go to the source code of this file.

Functions

HttpMethod httpRequestGetMethodId (HttpRequest this)
 

Variables

char * http_method [N_HTTP_METHOD]
 

Detailed Description

Author
Georg Hopp

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Definition in file get_method_id.c.

Function Documentation

HttpMethod httpRequestGetMethodId ( HttpRequest  this)

Definition at line 39 of file get_method_id.c.

References http_method, and N_HTTP_METHOD.

Referenced by httpRequestCtor().

40 {
41  int i;
42 
43  if (NULL == this->method)
44  return -1;
45 
46  for (i=0; i<N_HTTP_METHOD; i++) {
47  if (0 == strcmp(http_method[i], this->method))
48  break;
49  }
50 
51  if (i >= N_HTTP_METHOD) {
52  return -1;
53  }
54 
55  return (i);
56 }
#define N_HTTP_METHOD
Definition: request.h:31
char * http_method[N_HTTP_METHOD]
Definition: get_method_id.c:27

+ Here is the caller graph for this function:

Variable Documentation

char* http_method[N_HTTP_METHOD]
Initial value:
= {
"OPTIONS",
"GET",
"HEAD",
"POST",
"PUT",
"DELETE",
"TRACE",
"CONNECT"
}

Definition at line 27 of file get_method_id.c.

Referenced by httpRequestGetMethodId().