![]() |
MHEG5
18.9.0
MHEG5 Documentation
|
File based synchronous/asynchrounous ORM. More...
#include "mh5fileorm.h"
#include "mh5stream.h"
#include "mh5memory.h"
#include "mh5debug.h"
#include "mh5profile.h"
#include "mh5object.h"
#include "mh5queue.h"
#include "mh5gate.h"
#include "mh5misc.h"
#include "mh5control.h"
#include <string.h>
#include "glue_queue.h"
#include "glue_main.h"
#include "glue_timers.h"
#include "glue_dsmcc.h"
Go to the source code of this file.
Classes | |
struct | CiMessageContext_struct |
struct | sOrmFuncs |
struct | sOrmGetRequest |
struct | sOrmPostRequest |
struct | sOrmRequest |
Macros | |
#define | MAX_PATHNAME_LENGTH (1024) |
#define | MAX_CI_REQUESTS (1) |
#define | CI_ACK_TIMEOUT 9999 /* about 10 secs */ |
#define | MIN_HTTP_REPLY_BLOCK (128) |
#define | MAX_REDIRECTS (5) |
#define | DsmAlloc AllocRequest |
#define | CiAlloc AllocNothing |
#define | HttpAlloc AllocNothing |
#define | HybrAlloc AllocNothing |
#define | DEFAULT_ORIGIN ORIGIN_DSM |
#define | IS_HTTP_REQUEST(r) ((r)->origin == ORIGIN_HTTP || (r)->origin == ORIGIN_HTTPS) |
#define | IS_HTTPS_REQUEST(r) ((r)->origin == ORIGIN_HTTPS) |
#define | IS_HYBRID_REQUSET(r) ((r)->origin == ORIGIN_HYBRID) |
#define | CHECK_ORM_MAGIC |
#define | ORM_REQUEST_MAGIC 0xdeadbeef |
#define | ORM_REQUEST_BAD_MAGIC 0xfeedface |
#define | SET_ORM_MAGIC(r) (r)->magic = ORM_REQUEST_MAGIC |
#define | CLEAR_ORM_MAGIC(r) (r)->magic = ORM_REQUEST_BAD_MAGIC |
#define | VERIFY_ORM_MAGIC(r) assert((r)->magic == ORM_REQUEST_MAGIC) |
#define | PRINT_ERROR(x) |
#define | ORM_STATE_STRING(r) |
#define | CiAction DummyFunc |
#define | CiClear DummyFunc |
#define | HybrAction DummyFunc |
#define | HybrClear DummyFunc |
#define | HttpAction DummyFunc |
#define | HttpClear DummyFunc |
#define | PRINTFILE(t, n, d, s) |
Typedefs | |
typedef struct CiMessageContext_struct | CiMessageContext |
typedef struct sOrmRequest * | P_OrmRequest |
typedef struct sOrmFuncs | S_OrmFuncs |
typedef struct sOrmGetRequest | S_OrmGetRequest |
typedef struct sOrmPostRequest | S_OrmPostRequest |
typedef struct sOrmRequest | S_OrmRequest |
Functions | |
void | MHEG5FileOrmInit (void) |
Initialise the file ORM module. More... | |
void | MHEG5FileOrmReset (MHEG5FileOrmResetMode resetMode) |
Reset the ORM module. This function supports two modes: More... | |
BOOLEAN | MHEG5FileOrmIsReset (MHEG5FileOrmResetMode *resetMode) |
Tell whether the ORM module is currently being reset. If it is, the function also returns the current reset mode. This information is required in order to decide whether to generate an EngineEvent when a file load fails. If a file cannot be loaded (doesn't exist, timeout) then an event is required, but if a file load "fails" because the ORM module is being reset, then no event should be generated. resetMode is an optional parameter, and it can also be NULL. More... | |
BOOLEAN | MHEG5FileOrmProcess (void) |
Check for any file requests that have arrived since this function was last called. For each arrived file the callback will be called. The function may have to be called more than once in case a file the arrived affects other files as well. More... | |
void | MHEG5FileOrmClear (void *orm_ref) |
Remove outstanding file request for the given handle. More... | |
void * | MHEG5FileOrmGet (MHEG5String name, U16BIT priority, void *userData, F_CB_Good cbGood, F_CB_Fail cbFail) |
Get a file. The file will be loaded and one of the callback functions called when request is resolved. When file system acceleration is available, this may retrieve the file from NVM cache. More... | |
void * | MHEG5FileOrmRetrieve (E_FS_ORIGIN origin, S_STRING location, S_STRING name, U16BIT priority, void *userData, F_CB_Good cbGood, F_CB_Fail cbFail) |
Retrieve of a file. The file will be loaded and one of the callback functions called when request is resolved. This is intended to be used by the File System Acceleration code. More... | |
void | MHEG5FileOrmPreloadHint (MHEG5String name) |
Provide a preload hint to DSM-CC that the specified file may be required in the future. DSM-CC could (but is not required to) acquire the file into cache. More... | |
#define CHECK_ORM_MAGIC |
Definition at line 124 of file mh5fileorm.c.
#define CI_ACK_TIMEOUT 9999 /* about 10 secs */ |
Definition at line 84 of file mh5fileorm.c.
#define CiAction DummyFunc |
Definition at line 333 of file mh5fileorm.c.
#define CiAlloc AllocNothing |
Definition at line 98 of file mh5fileorm.c.
#define CiClear DummyFunc |
Definition at line 334 of file mh5fileorm.c.
#define CLEAR_ORM_MAGIC | ( | r | ) | (r)->magic = ORM_REQUEST_BAD_MAGIC |
Definition at line 130 of file mh5fileorm.c.
#define DEFAULT_ORIGIN ORIGIN_DSM |
Definition at line 113 of file mh5fileorm.c.
#define DsmAlloc AllocRequest |
Definition at line 90 of file mh5fileorm.c.
#define HttpAction DummyFunc |
Definition at line 379 of file mh5fileorm.c.
#define HttpAlloc AllocNothing |
Definition at line 105 of file mh5fileorm.c.
#define HttpClear DummyFunc |
Definition at line 380 of file mh5fileorm.c.
#define HybrAction DummyFunc |
Definition at line 377 of file mh5fileorm.c.
#define HybrAlloc AllocNothing |
Definition at line 106 of file mh5fileorm.c.
#define HybrClear DummyFunc |
Definition at line 378 of file mh5fileorm.c.
#define IS_HTTP_REQUEST | ( | r | ) | ((r)->origin == ORIGIN_HTTP || (r)->origin == ORIGIN_HTTPS) |
Definition at line 119 of file mh5fileorm.c.
#define IS_HTTPS_REQUEST | ( | r | ) | ((r)->origin == ORIGIN_HTTPS) |
Definition at line 120 of file mh5fileorm.c.
#define IS_HYBRID_REQUSET | ( | r | ) | ((r)->origin == ORIGIN_HYBRID) |
Definition at line 121 of file mh5fileorm.c.
#define MAX_CI_REQUESTS (1) |
Definition at line 82 of file mh5fileorm.c.
#define MAX_PATHNAME_LENGTH (1024) |
Definition at line 79 of file mh5fileorm.c.
#define MAX_REDIRECTS (5) |
Definition at line 87 of file mh5fileorm.c.
#define MIN_HTTP_REPLY_BLOCK (128) |
Definition at line 86 of file mh5fileorm.c.
#define ORM_REQUEST_BAD_MAGIC 0xfeedface |
Definition at line 128 of file mh5fileorm.c.
#define ORM_REQUEST_MAGIC 0xdeadbeef |
Definition at line 127 of file mh5fileorm.c.
#define ORM_STATE_STRING | ( | r | ) |
Definition at line 148 of file mh5fileorm.c.
#define PRINT_ERROR | ( | x | ) |
Definition at line 144 of file mh5fileorm.c.
#define PRINTFILE | ( | t, | |
n, | |||
d, | |||
s | |||
) |
Definition at line 820 of file mh5fileorm.c.
#define SET_ORM_MAGIC | ( | r | ) | (r)->magic = ORM_REQUEST_MAGIC |
Definition at line 129 of file mh5fileorm.c.
#define VERIFY_ORM_MAGIC | ( | r | ) | assert((r)->magic == ORM_REQUEST_MAGIC) |
Definition at line 131 of file mh5fileorm.c.
typedef struct CiMessageContext_struct CiMessageContext |
typedef struct sOrmRequest* P_OrmRequest |
Definition at line 227 of file mh5fileorm.c.
typedef struct sOrmFuncs S_OrmFuncs |
typedef struct sOrmGetRequest S_OrmGetRequest |
typedef struct sOrmPostRequest S_OrmPostRequest |
typedef struct sOrmRequest S_OrmRequest |
enum E_OrmState |
Definition at line 177 of file mh5fileorm.c.
enum E_OrmType |
Enumerator | |
---|---|
ORM_TYPE_GET | |
ORM_TYPE_FGR | |
ORM_TYPE_POST |
Definition at line 195 of file mh5fileorm.c.
void MHEG5FileOrmClear | ( | void * | orm_ref | ) |
Remove outstanding file request for the given handle.
Aborts a request for file.
orm_ref | Handle given back by MHEG5FileOrmGet |
Definition at line 979 of file mh5fileorm.c.
void* MHEG5FileOrmGet | ( | MHEG5String | name, |
U16BIT | priority, | ||
void * | userData, | ||
F_CB_Good | cbGood, | ||
F_CB_Fail | cbFail | ||
) |
Get a file. The file will be loaded and one of the callback functions called when request is resolved. When file system acceleration is available, this may retrieve the file from NVM cache.
name | Name of file to retrieve. This will be expanded using the rules specified by the UK1 profile. |
priority | Cache priority with which to fetch the object. |
userData | User data to be returned in callback functions. |
cbGood | Pointer to callback function that will be called when the file is retreived. |
cbFail | Pointer to callback function that will be called when the file cannot be retrieved. |
Definition at line 1179 of file mh5fileorm.c.
void MHEG5FileOrmInit | ( | void | ) |
Initialise the file ORM module.
Definition at line 576 of file mh5fileorm.c.
BOOLEAN MHEG5FileOrmIsReset | ( | MHEG5FileOrmResetMode * | resetMode | ) |
Tell whether the ORM module is currently being reset. If it is, the function also returns the current reset mode. This information is required in order to decide whether to generate an EngineEvent when a file load fails. If a file cannot be loaded (doesn't exist, timeout) then an event is required, but if a file load "fails" because the ORM module is being reset, then no event should be generated. resetMode is an optional parameter, and it can also be NULL.
resetMode | Reset mode (if return value is TRUE) |
Definition at line 712 of file mh5fileorm.c.
void MHEG5FileOrmPreloadHint | ( | MHEG5String | name | ) |
Provide a preload hint to DSM-CC that the specified file may be required in the future. DSM-CC could (but is not required to) acquire the file into cache.
name | Name of file to preload |
Definition at line 1554 of file mh5fileorm.c.
BOOLEAN MHEG5FileOrmProcess | ( | void | ) |
Check for any file requests that have arrived since this function was last called. For each arrived file the callback will be called. The function may have to be called more than once in case a file the arrived affects other files as well.
Definition at line 830 of file mh5fileorm.c.
void MHEG5FileOrmReset | ( | MHEG5FileOrmResetMode | resetMode | ) |
Reset the ORM module. This function supports two modes:
resetMode | Reset mode |
Definition at line 595 of file mh5fileorm.c.
void* MHEG5FileOrmRetrieve | ( | E_FS_ORIGIN | origin, |
S_STRING | location, | ||
S_STRING | name, | ||
U16BIT | priority, | ||
void * | userData, | ||
F_CB_Good | cbGood, | ||
F_CB_Fail | cbFail | ||
) |
Retrieve of a file. The file will be loaded and one of the callback functions called when request is resolved. This is intended to be used by the File System Acceleration code.
origin | Origin of file to retrieve. |
location | Path location of file to retrieve. |
name | Name of file to retrieve. |
priority | Cache priority with which to fetch the object. |
userData | User data to be returned in callback functions. |
cbGood | Pointer to callback function that will be called when the file is retreived. |
cbFail | Pointer to callback function that will be called when the file cannot be retrieved. |
Definition at line 1290 of file mh5fileorm.c.