OpenJPEG  2.2.0
Macros | Functions
session_manager.c File Reference
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include "session_manager.h"
#include "target_manager.h"

Macros

#define FCGI_stdout   stdout
 
#define FCGI_stderr   stderr
 
#define logstream   stderr
 

Functions

sessionlist_param_tgene_sessionlist (void)
 generate a session list More...
 
session_param_tgene_session (sessionlist_param_t *sessionlist)
 generate a session under the sesion list More...
 
OPJ_BOOL search_session_and_channel (char cid[], sessionlist_param_t *sessionlist, session_param_t **foundsession, channel_param_t **foundchannel)
 search a channel and its belonging session by channel ID More...
 
void insert_cachemodel_into_session (session_param_t *session, cachemodel_param_t *cachemodel)
 insert a cache model into a session More...
 
OPJ_BOOL delete_session (session_param_t **session, sessionlist_param_t *sessionlist)
 delete a session More...
 
void delete_sessionlist (sessionlist_param_t **sessionlist)
 delete session list More...
 
void print_allsession (sessionlist_param_t *sessionlist)
 print all sessions More...
 

Macro Definition Documentation

#define FCGI_stderr   stderr
#define FCGI_stdout   stdout
#define logstream   stderr

Function Documentation

OPJ_BOOL delete_session ( session_param_t **  session,
sessionlist_param_t sessionlist 
)

delete a session

Parameters
[in]sessionaddress of the session pointer
[in]sessionlistsession list pointer
Returns
if succeeded (true) or failed (false)

References delete_cachemodellist(), delete_channellist(), sessionlist_param::first, sessionlist_param::last, logstream, session_param::next, OPJ_FALSE, opj_free(), and OPJ_TRUE.

Referenced by close_channel().

void delete_sessionlist ( sessionlist_param_t **  sessionlist)

delete session list

Parameters
[in,out]sessionlistaddress of the session list pointer

References session_param::cachemodellist, session_param::channellist, delete_cachemodellist(), delete_channellist(), logstream, session_param::next, and opj_free().

session_param_t* gene_session ( sessionlist_param_t sessionlist)

generate a session under the sesion list

Parameters
[in]sessionlistsession list to insert the new session
Returns
pointer to the generated session

References session_param::cachemodellist, session_param::channellist, sessionlist_param::first, gene_cachemodellist(), gene_channellist(), sessionlist_param::last, session_param::next, and opj_malloc().

Referenced by open_channel().

sessionlist_param_t* gene_sessionlist ( void  )

generate a session list

Returns
pointer to the generated session list

References sessionlist_param::first, sessionlist_param::last, and opj_malloc().

void insert_cachemodel_into_session ( session_param_t session,
cachemodel_param_t cachemodel 
)

insert a cache model into a session

Parameters
[in]sessionsession pointer
[in]cachemodelcachemodel pointer

References session_param::cachemodellist, cachemodellist_param::first, cachemodellist_param::last, logstream, and cachemodel_param::next.

void print_allsession ( sessionlist_param_t sessionlist)
OPJ_BOOL search_session_and_channel ( char  cid[],
sessionlist_param_t sessionlist,
session_param_t **  foundsession,
channel_param_t **  foundchannel 
)

search a channel and its belonging session by channel ID

Parameters
[in]cidchannel identifier
[in]sessionlistsession list pointer
[in,out]foundsessionaddress of the found session pointer
[in,out]foundchanneladdress of the found channel pointer
Returns
if the channel is found (true) or not (false)

References FCGI_stdout, sessionlist_param::first, session_param::next, channel_param::next, OPJ_FALSE, and OPJ_TRUE.

Referenced by associate_channel(), and close_channel().