Network Services API  2.60.00.07
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 
101 typedef URLHandler_Handle (*URLHandler_CreateFxn)(void * params,
102  URLHandler_Session session);
103 
125 typedef int (*URLHandler_ProcessFxn)(URLHandler_Handle u, int method,
126  const char * url, const char * urlArgs, int contentLength, int s);
127 
144 typedef void (*URLHandler_ScanFieldFxn)(URLHandler_Handle u, int method,
145  const char * url, const char * field);
146 
156 typedef void (*URLHandler_DeleteFxn)(URLHandler_Handle * u);
157 
170 typedef void (*URLHandler_SendFxn)(URLHandler_Handle u, int s);
182 typedef struct URLHandler_Setup {
186  void * params;
187 
192 
197 
202 
207 
211  void * reserved1;
213 
215 #ifdef __cplusplus
216 }
217 #endif
218 
219 #endif
void * params
Parameters needed for URL Handler instantiation.
Definition: urlhandler.h:186
void * reserved1
This field is reserved - set to NULL.
Definition: urlhandler.h:211
URLHandler_CreateFxn create
URL Handler Create function.
Definition: urlhandler.h:191
URLHandler_DeleteFxn del
URL Handler Delete function.
Definition: urlhandler.h:196
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:125
void(* URLHandler_ScanFieldFxn)(URLHandler_Handle u, int method, const char *url, const char *field)
Scan for specific request headers.
Definition: urlhandler.h:144
struct URLHandler_Setup URLHandler_Setup
Structure containing URL Handler components.
Structure containing URL Handler components.
Definition: urlhandler.h:182
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:156
URLHandler_ProcessFxn process
URL Handler Process function.
Definition: urlhandler.h:201
URLHandler_ScanFieldFxn scanField
Scan field function.
Definition: urlhandler.h:206
URLHandler_Handle(* URLHandler_CreateFxn)(void *params, URLHandler_Session session)
Create a user-defined URLHandler_Object.
Definition: urlhandler.h:101
© Copyright 1995-2019, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale