MHEG  17.9.0
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Pages
Functions
mh5base.c File Reference

Implement basic functions for the MHEG5 defined basic data types. More...

#include "mh5memory.h"
#include "mh5base.h"
#include "mh5debug.h"
#include "stb_os.h"
#include <string.h>
#include <stdlib.h>

Functions

MHEG5String MHEG5stringCopy (MHEG5String source)
 <Function description>=""> More...
 
MHEG5String MHEG5stringCopyChr (const char *source)
 Copy the C-String source to a MHEG5String. More...
 
MHEG5String MHEG5stringCat (MHEG5String source1, MHEG5String source2)
 Concatenate two MHEG5Strings. More...
 
void MHEG5stringDestruct (MHEG5String *item)
 Destruct a MHEG5String. More...
 
MHEG5Bool MHEG5stringEqual (MHEG5String *s1, MHEG5String *s2)
 Compare two Strings (case sensitive!) More...
 
MHEG5Int MHEG5strToInt (MHEG5String string)
 Convert a MHEG5String to a MHEG5Integer. More...
 
MHEG5String MHEG5intToStr (MHEG5Int i)
 Convert MHEG5Int to MHEG5String. More...
 
void MHEG5genericDestruct (MHEG5Generic *item)
 Destruct a MHEG5Generic. More...
 
void MHEG5genericCopy (MHEG5Generic *dest, MHEG5Generic *src)
 Copy a MHEG5Generic. More...
 
MHEG5Bool MHEG5genericEqual (MHEG5Generic *g1, MHEG5Generic *g2)
 Compare two generic Variables. More...
 
void MHEG5gListDestruct (MHEG5GList *item)
 Destruct a list of MHEG5Generic objects. More...
 
MHEG5GListMHEG5gListCopy (MHEG5GList *list)
 Copy a list of MHEG5Generic objects. More...
 
void MHEG5genericSet (MHEG5Generic *item, MHEG5Int initialValue)
 Set a MHEG5Generic to the MHEG5Int value. More...
 
unsigned long MHEG5random (void)
 Calculate and return a psuedo random number. More...
 
char * MHEG5safeStrcat (char *dest, size_t destLength, const char *source)
 Perform a standard strcat restricted to the length of the destination. The dest string will always be null terminated. More...
 

Detailed Description

Implement basic functions for the MHEG5 defined basic data types.

Date
29/01/2002
Author
iwillis

Function Documentation

void MHEG5genericCopy ( MHEG5Generic dest,
MHEG5Generic src 
)

Copy a MHEG5Generic.

Parameters
MHEG5Generic* dest
MHEG5Generic* src
Returns
void
void MHEG5genericDestruct ( MHEG5Generic item)

Destruct a MHEG5Generic.

Parameters
MHEG5Generic* item
Returns
void
MHEG5Bool MHEG5genericEqual ( MHEG5Generic g1,
MHEG5Generic g2 
)

Compare two generic Variables.

Parameters
MHEG5Generic* g1
MHEG5Generic* g2
Returns
MHEG5Bool MHEG5Bool
void MHEG5genericSet ( MHEG5Generic item,
MHEG5Int  initialValue 
)

Set a MHEG5Generic to the MHEG5Int value.

Parameters
MHEG5Generic* item
MHEG5IntinitialValue
Returns
void
MHEG5GList* MHEG5gListCopy ( MHEG5GList list)

Copy a list of MHEG5Generic objects.

Parameters
MHEG5GList*list
Returns
MHEG5GList * Pointer to the first element of the new MHEG5GList
void MHEG5gListDestruct ( MHEG5GList item)

Destruct a list of MHEG5Generic objects.

Parameters
MHEG5GList*item
Returns
void
MHEG5String MHEG5intToStr ( MHEG5Int  i)

Convert MHEG5Int to MHEG5String.

Parameters
MHEG5Inti
Returns
MHEG5String MHEG5String
unsigned long MHEG5random ( void  )

Calculate and return a psuedo random number.

Returns
Next random number in the sequence
char* MHEG5safeStrcat ( char *  dest,
size_t  destLength,
const char *  source 
)

Perform a standard strcat restricted to the length of the destination. The dest string will always be null terminated.

Parameters
destDestination to concatenate string to.
destLengthMaximum length of the destination string, including null termination.
sourceNull terminated string to concatenate with the destination.
Returns
Pointer to dest
MHEG5String MHEG5stringCat ( MHEG5String  source1,
MHEG5String  source2 
)

Concatenate two MHEG5Strings.

Parameters
MHEG5Stringsource1
MHEG5Stringsource2
Returns
MHEG5String MHEG5String
MHEG5String MHEG5stringCopy ( MHEG5String  source)

<Function description>="">

Returns
<Return value>=""> Copy a MHEG5String and return the new MHEG5String
Parameters
MHEG5Stringsource
Returns
MHEG5String MHEG5String
MHEG5String MHEG5stringCopyChr ( const char *  source)

Copy the C-String source to a MHEG5String.

Parameters
char*source
Returns
MHEG5String MHEG5String
void MHEG5stringDestruct ( MHEG5String item)

Destruct a MHEG5String.

Parameters
MHEG5Stringitem
Returns
void
MHEG5Bool MHEG5stringEqual ( MHEG5String s1,
MHEG5String s2 
)

Compare two Strings (case sensitive!)

Parameters
MHEG5Strings1
MHEG5Strings2
Returns
MHEG5Bool MHEG5Bool
MHEG5Int MHEG5strToInt ( MHEG5String  string)

Convert a MHEG5String to a MHEG5Integer.

Parameters
MHEG5Stringstring
Returns
MHEG5Int MHEG5Int