Network Services API  2.75.00.17
urlhandler.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2014-2018, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
33 /*
34  * ======== ti/net/http/urlhandler.h ========
35  */
46 #ifndef ti_net_http__URLHandler__include
47 #define ti_net_http__URLHandler__include
48 
51 
52 #include <stddef.h>
53 
54 #ifdef __cplusplus
55 extern "C" {
56 #endif
57 
58 #define URLHandler_GET 1
59 #define URLHandler_POST 2
60 #define URLHandler_PUT 3
61 #define URLHandler_PATCH 4
62 #define URLHandler_DELETE 5
63 
64 #define URLHandler_ENOTHANDLED 0
65 #define URLHandler_EHANDLED 1
66 #define URLHandler_EERRORHANDLED 2
67 #define URLHandler_EHANDLEDSTOP 3
68 
77 typedef struct URLHandler_Object * URLHandler_Handle;
78 typedef struct URLHandler_State * URLHandler_Session;
79 
104 typedef URLHandler_Handle (*URLHandler_CreateFxn)(void * params,
105  URLHandler_Session session);
106 
165 typedef int (*URLHandler_ProcessFxn)(URLHandler_Handle u, int method,
166  const char * url, const char * urlArgs, int contentLength, int s);
167 
186 typedef void (*URLHandler_ScanFieldFxn)(URLHandler_Handle u, int method,
187  const char * url, const char * field);
188 
200 typedef void (*URLHandler_DeleteFxn)(URLHandler_Handle * u);
201 
214 typedef void (*URLHandler_SendFxn)(URLHandler_Handle u, int s);
226 typedef struct URLHandler_Setup {
230  void * params;
231 
236 
241 
246 
251 
255  void * reserved1;
257 
259 #ifdef __cplusplus
260 }
261 #endif
262 
263 #endif
void * params
Parameters needed for URL Handler instantiation.
Definition: urlhandler.h:230
void * reserved1
This field is reserved - set to NULL.
Definition: urlhandler.h:255
URLHandler_CreateFxn create
URL Handler Create function.
Definition: urlhandler.h:235
URLHandler_DeleteFxn del
URL Handler Delete function.
Definition: urlhandler.h:240
struct URLHandler_State * URLHandler_Session
Definition: urlhandler.h:78
int(* URLHandler_ProcessFxn)(URLHandler_Handle u, int method, const char *url, const char *urlArgs, int contentLength, int s)
Process an HTTP request.
Definition: urlhandler.h:165
void(* URLHandler_ScanFieldFxn)(URLHandler_Handle u, int method, const char *url, const char *field)
Scan for specific request headers.
Definition: urlhandler.h:186
struct URLHandler_Setup URLHandler_Setup
Structure containing URL Handler components.
Structure containing URL Handler components.
Definition: urlhandler.h:226
struct URLHandler_Object * URLHandler_Handle
A placeholder used to refer to a user-defined type.
Definition: urlhandler.h:77
void(* URLHandler_DeleteFxn)(URLHandler_Handle *u)
Delete a URLHandler.
Definition: urlhandler.h:200
URLHandler_ProcessFxn process
URL Handler Process function.
Definition: urlhandler.h:245
URLHandler_ScanFieldFxn scanField
Scan field function.
Definition: urlhandler.h:250
URLHandler_Handle(* URLHandler_CreateFxn)(void *params, URLHandler_Session session)
Create a user-defined URLHandler_Object.
Definition: urlhandler.h:104
© Copyright 1995-2020, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale