OpenJPEG  2.5.0
Functions
cache_manager.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "cache_manager.h"

Functions

cachelist_param_tgene_cachelist (void)
 generate a cache list More...
 
void delete_cachelist (cachelist_param_t **cachelist)
 delete cache list More...
 
cache_param_tgene_cache (const char *targetname, int csn, char *tid, char *cid)
 generate a cache More...
 
void delete_cache (cache_param_t **cache)
 delete a cache More...
 
void insert_cache_into_list (cache_param_t *cache, cachelist_param_t *cachelist)
 insert a cache into list More...
 
cache_param_tsearch_cache (const char targetname[], cachelist_param_t *cachelist)
 search a cache by target name More...
 
cache_param_tsearch_cacheBycsn (int csn, cachelist_param_t *cachelist)
 search a cache by csn More...
 
cache_param_tsearch_cacheBycid (const char cid[], cachelist_param_t *cachelist)
 search a cache by cid More...
 
cache_param_tsearch_cacheBytid (const char tid[], cachelist_param_t *cachelist)
 search a cache by tid More...
 
void add_cachecid (const char *cid, cache_param_t *cache)
 add cid into a cache More...
 
void update_cachetid (const char *tid, cache_param_t *cache)
 update tid of a cache More...
 
void remove_cidInCache (const char *cid, cache_param_t *cache)
 
void remove_cachecid (const char *cid, cachelist_param_t *cachelist)
 remove cid in cache More...
 
void print_cache (cache_param_t *cache)
 print cache parameters More...
 
void print_allcache (cachelist_param_t *cachelist)
 print all cache parameters More...
 

Function Documentation

◆ add_cachecid()

void add_cachecid ( const char *  cid,
cache_param_t cache 
)

add cid into a cache

Parameters
[in]cidchannel identifier
[in]cachecache pointer

References cache_param::cid, and cache_param::numOfcid.

Referenced by handle_JPIPstreamMSG().

◆ delete_cache()

void delete_cache ( cache_param_t **  cache)

delete a cache

Parameters
[in]cacheaddress of the cache pointer

References delete_metadatalist().

Referenced by delete_cachelist().

◆ delete_cachelist()

void delete_cachelist ( cachelist_param_t **  cachelist)

delete cache list

Parameters
[in,out]cachelistaddress of the cache list pointer

References delete_cache(), and cache_param::next.

Referenced by terminate_dec_server().

◆ gene_cache()

cache_param_t* gene_cache ( const char *  targetname,
int  csn,
char *  tid,
char *  cid 
)

generate a cache

Parameters
[in]targetnametarget file name
[in]csncodestream number
[in]tidtarget identifier
[in]cidchannel identifier
Returns
pointer to the generated cache

References cache_param::cid, cache_param::csn, cache_param::filename, gene_metadatalist(), cache_param::ihdrbox, cache_param::metadatalist, cache_param::next, cache_param::numOfcid, and cache_param::tid.

Referenced by handle_JPIPstreamMSG().

◆ gene_cachelist()

cachelist_param_t* gene_cachelist ( void  )

generate a cache list

Returns
pointer to the generated cache list

References cachelist_param::first, and cachelist_param::last.

Referenced by init_dec_server().

◆ insert_cache_into_list()

void insert_cache_into_list ( cache_param_t cache,
cachelist_param_t cachelist 
)

insert a cache into list

Parameters
[in]cachecache pointer
[in]cachelistcache list pointer

References cachelist_param::first, cachelist_param::last, and cache_param::next.

Referenced by handle_JPIPstreamMSG().

◆ print_allcache()

void print_allcache ( cachelist_param_t cachelist)

print all cache parameters

Parameters
[in]cachelistcache list pointer

References cachelist_param::first, cache_param::next, and print_cache().

◆ print_cache()

void print_cache ( cache_param_t cache)

print cache parameters

Parameters
[in]cachecache pointer

References cache_param::cid, cache_param::csn, cache_param::filename, cache_param::numOfcid, and cache_param::tid.

Referenced by print_allcache().

◆ remove_cachecid()

void remove_cachecid ( const char *  cid,
cachelist_param_t cachelist 
)

remove cid in cache

Parameters
[in]cidchannel identifier
[in]cachelistcachelist pointer

References remove_cidInCache(), and search_cacheBycid().

Referenced by handle_dstCIDreqMSG().

◆ remove_cidInCache()

void remove_cidInCache ( const char *  cid,
cache_param_t cache 
)

References cache_param::cid, and cache_param::numOfcid.

Referenced by remove_cachecid().

◆ search_cache()

cache_param_t* search_cache ( const char  targetname[],
cachelist_param_t cachelist 
)

search a cache by target name

Parameters
[in]targetnametarget filename
[in]cachelistcache list pointer
Returns
found cache pointer

References cache_param::filename, cachelist_param::first, and cache_param::next.

Referenced by handle_CIDreqMSG(), handle_JPIPstreamMSG(), and handle_TIDreqMSG().

◆ search_cacheBycid()

cache_param_t* search_cacheBycid ( const char  cid[],
cachelist_param_t cachelist 
)

search a cache by cid

Parameters
[in]cidchannel identifier
[in]cachelistcache list pointer
Returns
found cache pointer

References cache_param::cid, cachelist_param::first, cache_param::next, and cache_param::numOfcid.

Referenced by handle_JP2saveMSG(), handle_PNMreqMSG(), handle_SIZreqMSG(), handle_XMLreqMSG(), and remove_cachecid().

◆ search_cacheBycsn()

cache_param_t* search_cacheBycsn ( int  csn,
cachelist_param_t cachelist 
)

search a cache by csn

Parameters
[in]csncodestream number
[in]cachelistcache list pointer
Returns
found cache pointer

References cache_param::csn, cachelist_param::first, and cache_param::next.

Referenced by handle_JPIPstreamMSG().

◆ search_cacheBytid()

cache_param_t* search_cacheBytid ( const char  tid[],
cachelist_param_t cachelist 
)

search a cache by tid

Parameters
[in]tidtarget identifier
[in]cachelistcache list pointer
Returns
found cache pointer

References cachelist_param::first, cache_param::next, and cache_param::tid.

Referenced by handle_PNMreqMSG(), and handle_SIZreqMSG().

◆ update_cachetid()

void update_cachetid ( const char *  tid,
cache_param_t cache 
)

update tid of a cache

Parameters
[in]tidtarget identifier
[in]cachecache pointer

References cache_param::filename, and cache_param::tid.

Referenced by handle_JPIPstreamMSG().