MHEG5  18.9.0
MHEG5 Documentation
Functions
mh5gate.c File Reference

Implement Functions to support Service Gateways. Functions for standarizing several GroupIDs like +DSM:// +~/ +DSM:/ +CI:/ +etc. More...

#include <string.h>
#include "mh5base.h"
#include "mh5memory.h"
#include "mh5application.h"
#include "mh5debug.h"
#include "mh5profile.h"
#include "mh5gate.h"

Go to the source code of this file.

Functions

MHEG5Int MHEG5FullOriginLength (E_FS_ORIGIN origin)
 Get length for origin (e.g. "DSM://" is 6) More...
 
MHEG5Bool MHEG5ResolveOrigin (MHEG5String *ref, E_FS_ORIGIN *orig, MHEG5Int *offset)
 Resolve the orig of a reference. More...
 
MHEG5String MHEG5convertGID (MHEG5String *inRef)
 Convert a group ID from a relative reference to an absolute reference. See UK1.05 section 8.3.2 for the rules used for conversion. See UK1.06 section 9.17.2 for maximum length of fully resolved path. More...
 
MHEG5String MHEG5convertGIDGetOrigin (MHEG5String *inRef, E_FS_ORIGIN *pOrigin)
 Convert a group ID from a relative reference to an absolute reference. See UK1.05 section 8.3.2 for the rules used for conversion. More...
 
MHEG5String MHEG5CreateUrl (E_FS_ORIGIN origin, S_STRING path, S_STRING name)
 Convert a group ID from a relative reference to an absolute reference. See UK1.05 section 8.3.2 for the rules used for conversion. More...
 
MHEG5Bool MHEG5sameGroup (MH5GroupPtr gptr, MH5GroupRef gref)
 Compares two group ID strings to see whether they both reference the same group. The first string is an absolute GID, the second can be a relative group ID and will be converted to absolute prior to the comparison, so two different references that resolve to reference the same group ID produces a True return value. More...
 
MHEG5Bool MHEG5sameGroups (MH5GroupRef gref1, MH5GroupRef gref2)
 Compares two group ID strings to see whether they both reference the same group. Relative group ID strings are converted to absolute prior to the comparison, so two different references that resolve to reference the same group ID produces a True return value. More...
 
void MHEG5setWorkingDir (MHEG5String app_dir)
 Set the working directory for the current application. This is used to resolve relative paths. More...
 

Detailed Description

Implement Functions to support Service Gateways. Functions for standarizing several GroupIDs like +DSM:// +~/ +DSM:/ +CI:/ +etc.

Date
01/02/2002
Author
R.Freeman

Definition in file mh5gate.c.

Function Documentation

MHEG5String MHEG5convertGID ( MHEG5String inRef)

Convert a group ID from a relative reference to an absolute reference. See UK1.05 section 8.3.2 for the rules used for conversion. See UK1.06 section 9.17.2 for maximum length of fully resolved path.

Convert a group ID from a relative reference to an absolute reference. See UK1.05 section 8.3.2 for the rules used for conversion.

Parameters
inRefRelative group ID to convert.
Returns
Absolute group ID reference

Definition at line 269 of file mh5gate.c.

MHEG5String MHEG5convertGIDGetOrigin ( MHEG5String inRef,
E_FS_ORIGIN pOrigin 
)

Convert a group ID from a relative reference to an absolute reference. See UK1.05 section 8.3.2 for the rules used for conversion.

Parameters
inRefRelative group ID to convert.
pOriginPointer to origin of reference
Returns
Absolute group ID reference

Definition at line 282 of file mh5gate.c.

MHEG5String MHEG5CreateUrl ( E_FS_ORIGIN  origin,
S_STRING  path,
S_STRING  name 
)

Convert a group ID from a relative reference to an absolute reference. See UK1.05 section 8.3.2 for the rules used for conversion.

Parameters
originOrigin of reference
pathlocation or path.
fnamefile name.
Returns
Allocated absolute URL (or group ID) reference

Definition at line 444 of file mh5gate.c.

MHEG5Int MHEG5FullOriginLength ( E_FS_ORIGIN  origin)

Get length for origin (e.g. "DSM://" is 6)

Parameters
originreference origin
Returns
Length of origin

Definition at line 192 of file mh5gate.c.

MHEG5Bool MHEG5ResolveOrigin ( MHEG5String ref,
E_FS_ORIGIN orig,
MHEG5Int offset 
)

Resolve the orig of a reference.

Resolve the origin of a reference.

Parameters
refInput reference
origSource of reference
offsetOffset in input after orig
Returns
MHEG5TRUE if successful, MHEG5FALSE otherwise

Definition at line 208 of file mh5gate.c.

MHEG5Bool MHEG5sameGroup ( MH5GroupPtr  gptr,
MH5GroupRef  gref 
)

Compares two group ID strings to see whether they both reference the same group. The first string is an absolute GID, the second can be a relative group ID and will be converted to absolute prior to the comparison, so two different references that resolve to reference the same group ID produces a True return value.

Compares group ptr with group ref to see whether they both reference the same group. The first is pointer to group, the second can be a relative group name and will be converted to absolute prior to the comparison, so two different references that resolve to reference the same group name produces a True return value.

Parameters
gid1First group ID to compare (absolute)
gid2Second group ID to compare (absolute or relative)
Returns
MHEG5FALSE - The two references refer to different group IDs. MHEG5TRUE - The two references refer to the same group IDs.

Definition at line 517 of file mh5gate.c.

MHEG5Bool MHEG5sameGroups ( MH5GroupRef  gref1,
MH5GroupRef  gref2 
)

Compares two group ID strings to see whether they both reference the same group. Relative group ID strings are converted to absolute prior to the comparison, so two different references that resolve to reference the same group ID produces a True return value.

Parameters
gid1First group ID to compare
gid2Second group ID to compare
Returns
MHEG5FALSE - The two references refer to different group IDs. MHEG5TRUE - The two references refer to the same group IDs.

Definition at line 533 of file mh5gate.c.

void MHEG5setWorkingDir ( MHEG5String  app_dir)

Set the working directory for the current application. This is used to resolve relative paths.

Parameters
app_dirApplication name of new application. This must be an absolute path.
Returns
void

Definition at line 583 of file mh5gate.c.

Variable Documentation

const char* data

Definition at line 56 of file mh5gate.c.

int len

Definition at line 57 of file mh5gate.c.