[trunk] Import rev 1103 into trunk.
[openjpeg.git] / applications / jpip / libopenjpip / jpip_parser.h
1 /*
2  * $Id$
3  *
4  * Copyright (c) 2002-2011, Communications and Remote Sensing Laboratory, Universite catholique de Louvain (UCL), Belgium
5  * Copyright (c) 2002-2011, Professor Benoit Macq
6  * Copyright (c) 2010-2011, Kaori Hagihara 
7  * Copyright (c) 2011,      Lucian Corlaciu, GSoC
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions
12  * are met:
13  * 1. Redistributions of source code must retain the above copyright
14  *    notice, this list of conditions and the following disclaimer.
15  * 2. Redistributions in binary form must reproduce the above copyright
16  *    notice, this list of conditions and the following disclaimer in the
17  *    documentation and/or other materials provided with the distribution.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  */
31
32 #ifndef         JPIP_PARSER_H_
33 # define        JPIP_PARSER_H_
34
35 #include "bool.h"
36 #include "query_parser.h"
37 #include "session_manager.h"
38 #include "target_manager.h"
39 #include "msgqueue_manager.h"
40 #include "channel_manager.h"
41
42 /**
43  * REQUEST: target identification by target or tid request
44  *
45  * @param[in]     query_param   structured query
46  * @param[in]     targetlist    target list pointer
47  * @param[out]    target        address of target pointer
48  * @return                      if succeeded (true) or failed (false)
49  */
50 bool identify_target( query_param_t query_param, targetlist_param_t *targetlist, target_param_t **target);
51
52 /**
53  * REQUEST: channel association
54  *          this must be processed before any process
55  *
56  * @param[in]     query_param   structured query
57  * @param[in]     sessionlist   session list pointer
58  * @param[out]    cursession    address of the associated session pointer
59  * @param[out]    curchannel    address of the associated channel pointer
60  * @return                      if succeeded (true) or failed (false)
61  */
62 bool associate_channel( query_param_t    query_param, 
63                         sessionlist_param_t *sessionlist,
64                         session_param_t **cursession, 
65                         channel_param_t **curchannel);
66 /**
67  * REQUEST: new channel (cnew) assignment
68  *
69  * @param[in]     query_param   structured query
70  * @param[in]     sessionlist   session list pointer
71  * @param[in]     auxtrans      auxiliary transport
72  * @param[in]     target        requested target pointer
73  * @param[in,out] cursession    address of the associated/opened session pointer
74  * @param[in,out] curchannel    address of the associated/opened channel pointer
75  * @return                      if succeeded (true) or failed (false)
76  */
77 bool open_channel( query_param_t query_param, 
78                    sessionlist_param_t *sessionlist,
79                    auxtrans_param_t auxtrans,
80                    target_param_t *target,
81                    session_param_t **cursession, 
82                    channel_param_t **curchannel);
83
84 /**
85  * REQUEST: channel close (cclose)
86  *
87  * @param[in]     query_param   structured query
88  * @param[in]     sessionlist   session list pointer
89  * @param[in,out] cursession    address of the session pointer of deleting channel
90  * @param[in,out] curchannel    address of the deleting channel pointer
91  * @return                      if succeeded (true) or failed (false)
92  */
93 bool close_channel( query_param_t query_param, 
94                     sessionlist_param_t *sessionlist,
95                     session_param_t **cursession, 
96                     channel_param_t **curchannel);
97
98 /**
99  * REQUEST: view-window (fsiz)
100  *
101  * @param[in]     query_param structured query
102  * @param[in]     target      requested target pointer
103  * @param[in,out] cursession  associated session pointer
104  * @param[in,out] curchannel  associated channel pointer
105  * @param[out]    msgqueue    address of the message queue pointer
106  * @return                    if succeeded (true) or failed (false)
107  */
108 bool gene_JPIPstream( query_param_t query_param,
109                       target_param_t *target,
110                       session_param_t *cursession, 
111                       channel_param_t *curchannel,
112                       msgqueue_param_t **msgqueue);
113
114 #endif      /* !JPIP_PARSER_H_ */