Main Page   File List   File Members   Related Pages  

frdi_game.h File Reference

function headers for frdi_game.c More...

Go to the source code of this file.

Functions

char * frdiGameParseGameId (frdi_app *self, frdi_message *message)
frdi_list * frdiGameParseGameIdParts (frdi_app *self, char *game_id)
char * frdiGameParseGameMessage (frdi_app *self, frdi_message *message)
frdi_list * frdiGameRangeToList (frdi_app *self, char *range)
char * frdiGameListToRange (frdi_app *self, frdi_list *user_ids)
frdi_game_modulo * frdiGameModuloFromBigint (frdi_app *self, frdi_bigint *num)
frdi_game_modulo * frdiGameModuloFromString (frdi_app *self, char *text)
frdi_bigint * frdiGameModuloToBigint (frdi_app *self, frdi_game_modulo *modulo)
char * frdiGameModuloToString (frdi_app *self, frdi_game_modulo *modulo)
frdi_game_usertext * frdiGameUsertextNew (frdi_app *self, frdi_game_modulo *modulo)
frdi_game_usertext * frdiGameUsertextFromBigint (frdi_app *self, frdi_bigint *num)
frdi_game_usertext * frdiGameUsertextFromString (frdi_app *self, char *text)
frdi_bigint * frdiGameUsertextToBigint (frdi_app *self, frdi_game_usertext *usertext)
char * frdiGameUsertextToString (frdi_app *self, frdi_game_usertext *usertext)
frdi_game_digest * frdiGameDigestFromBigint (frdi_app *self, frdi_bigint *num)
frdi_game_digest * frdiGameDigestFromString (frdi_app *self, char *text)
frdi_bigint * frdiGameDigestToBigint (frdi_app *self, frdi_game_digest *digest)
char * frdiGameDigestToString (frdi_app *self, frdi_game_digest *digest)
int frdiGameDigestIsEqual (frdi_app *self, frdi_game_digest *one, frdi_game_digest *two)
frdi_game_sharedtext * frdiGameSharedtextNew (frdi_app *self, char *hostid, char *gameid, char *timeid)
frdi_game_sharedtext * frdiGameSharedtextFromString (frdi_app *self, char *text)
char * frdiGameSharedtextToString (frdi_app *self, frdi_game_sharedtext *sharedtext)
char * frdiGameSharedtextGetHostid (frdi_app *self, frdi_game_sharedtext *sharedtext)
char * frdiGameSharedtextGetGameid (frdi_app *self, frdi_game_sharedtext *sharedtext)
char * frdiGameSharedtextGetTimeid (frdi_app *self, frdi_game_sharedtext *sharedtext)
char * frdiGameSharedtextGetPadding (frdi_app *self, frdi_game_sharedtext *sharedtext)
char * frdiGameSharedtextPaddingNew (frdi_app *self, int len)
frdi_game_plaintext * frdiGamePlaintextNew (frdi_app *self, frdi_game_sharedtext *sharedtext, frdi_game_usertext *usertext)
frdi_game_plaintext * frdiGamePlaintextFromString (frdi_app *self, char *text)
char * frdiGamePlaintextToString (frdi_app *self, frdi_game_plaintext *plaintext)
frdi_game_sharedtext * frdiGamePlaintextGetSharedtext (frdi_app *self, frdi_game_plaintext *plaintext)
frdi_game_usertext * frdiGamePlaintextGetUsertext (frdi_app *self, frdi_game_plaintext *plaintext)
frdi_game_digest * frdiGamePlaintextGetDigest (frdi_app *self, frdi_game_plaintext *plaintext)
int frdiGamePlaintextVerifyDigest (frdi_app *self, frdi_game_plaintext *plaintext, frdi_game_digest *digest)
frdi_game_properties * frdiGamePropertiesNew (frdi_app *self, int size, frdi_game_modulo *modulo, frdi_game_sharedtext *sharedtext)
void frdiGamePropertiesSetModulo (frdi_app *self, frdi_game_properties *properties, frdi_game_modulo *modulo)
void frdiGamePropertiesSetSharedtext (frdi_app *self, frdi_game_properties *properties, frdi_game_sharedtext *sharedtext)
void frdiGamePropertiesSetSize (frdi_app *self, frdi_game_properties *properties, int size)
frdi_game_modulo * frdiGamePropertiesGetModulo (frdi_app *self, frdi_game_properties *properties)
frdi_game_sharedtext * frdiGamePropertiesGetSharedtext (frdi_app *self, frdi_game_properties *properties)
int frdiGamePropertiesGetSize (frdi_app *self, frdi_game_properties *properties)
char * frdiGamePropertiesDescribe (frdi_app *self, frdi_game_properties *properties)
frdi_game_input * frdiGameInputNew (frdi_app *self, frdi_game_usertext *usertext, frdi_game_modulo *modulo)
frdi_game_input * frdiGameInputFromBigint (frdi_app *self, frdi_bigint *num)
frdi_game_input * frdiGameInputFromString (frdi_app *self, char *text)
frdi_bigint * frdiGameInputToBigint (frdi_app *self, frdi_game_input *input)
char * frdiGameInputToString (frdi_app *self, frdi_game_input *input)
frdi_game_output * frdiGameOutputNew (frdi_app *self, frdi_game_properties *properties, frdi_list *inputs)
frdi_game_output * frdiGameOutputFromBigint (frdi_app *self, frdi_bigint *num)
frdi_game_output * frdiGameOutputFromString (frdi_app *self, char *text)
frdi_bigint * frdiGameOutputToBigint (frdi_app *self, frdi_game_output *output)
char * frdiGameOutputToString (frdi_app *self, frdi_game_output *output)


Detailed Description

function headers for frdi_game.c

Author:
Douglas Reay <douglas-legal@reay.org>
Warning:
GAME PATTERN

most of the frdi_game_* classes are wrappers around a frdi_bigint * or char * frdiGameFooFromBigint - sets the raw bigint, creates the text version from it frdiGameFooFromString - sets the raw text shows, may create the bigint from it frdiGameFooFromBar - creates the Foo from Bar which contains all info needed frdiGameFooNew - creates the Foo from the arguments which " " " frdiGameFooToBigint - returns an already calculated variable frdiGameFooToString - returns an already calculated variable frdiGameFooToBar - returns an already calculated variable frdiGameFooSetBar - Bar is insufficient to create a new Foo frdiGameFooGetBar - Bar is insufficient to create a new Foo


Function Documentation

char* frdiGameParseGameId frdi_app *    self,
frdi_message *    message
 

return <gamestr> from G <gamestr> | <remainder>

frdi_list* frdiGameParseGameIdParts frdi_app *    self,
char *    game_id
 

return ( <server_id>, <host_id>, <straight_game_id ) from <complex_game_id> (or just server,host from link_id)

char* frdiGameParseGameMessage frdi_app *    self,
frdi_message *    message
 

return <remainder> from G <gamestr> | <remainder>

frdi_list* frdiGameRangeToList frdi_app *    self,
char *    range
 

convert a list of string user_id from a string range "1,2,4-7"

char* frdiGameListToRange frdi_app *    self,
frdi_list *    user_ids
 

convert a list of string user_id to a string range "1,2,4-7" (assumes the list is in increasing numerical order)

frdi_game_modulo* frdiGameModuloFromBigint frdi_app *    self,
frdi_bigint *    num
 

see Game Pattern

frdi_game_modulo* frdiGameModuloFromString frdi_app *    self,
char *    text
 

see Game Pattern

frdi_bigint* frdiGameModuloToBigint frdi_app *    self,
frdi_game_modulo *    modulo
 

see Game Pattern

char* frdiGameModuloToString frdi_app *    self,
frdi_game_modulo *    modulo
 

see Game Pattern

frdi_game_usertext* frdiGameUsertextNew frdi_app *    self,
frdi_game_modulo *    modulo
 

see Game Pattern usertext = 250 length hex

frdi_game_usertext* frdiGameUsertextFromBigint frdi_app *    self,
frdi_bigint *    num
 

see Game Pattern

frdi_game_usertext* frdiGameUsertextFromString frdi_app *    self,
char *    text
 

see Game Pattern

frdi_bigint* frdiGameUsertextToBigint frdi_app *    self,
frdi_game_usertext *    usertext
 

see Game Pattern

char* frdiGameUsertextToString frdi_app *    self,
frdi_game_usertext *    usertext
 

see Game Pattern

frdi_game_digest* frdiGameDigestFromBigint frdi_app *    self,
frdi_bigint *    num
 

see Game Pattern

frdi_game_digest* frdiGameDigestFromString frdi_app *    self,
char *    text
 

see Game Pattern

frdi_bigint* frdiGameDigestToBigint frdi_app *    self,
frdi_game_digest *    digest
 

see Game Pattern

char* frdiGameDigestToString frdi_app *    self,
frdi_game_digest *    digest
 

see Game Pattern

int frdiGameDigestIsEqual frdi_app *    self,
frdi_game_digest *    one,
frdi_game_digest *    two
 

return 1 if the two digests are equal return 0 otheriwse

frdi_game_sharedtext* frdiGameSharedtextNew frdi_app *    self,
char *    hostid,
char *    gameid,
char *    timeid
 

see Game Pattern sharedtext = 250 length string = "hostid ^ gameid ^ timeid ^ padding ^ "

frdi_game_sharedtext* frdiGameSharedtextFromString frdi_app *    self,
char *    text
 

see Game Pattern

char* frdiGameSharedtextToString frdi_app *    self,
frdi_game_sharedtext *    sharedtext
 

see Game Pattern

char* frdiGameSharedtextGetHostid frdi_app *    self,
frdi_game_sharedtext *    sharedtext
 

see Game Pattern

char* frdiGameSharedtextGetGameid frdi_app *    self,
frdi_game_sharedtext *    sharedtext
 

see Game Pattern

char* frdiGameSharedtextGetTimeid frdi_app *    self,
frdi_game_sharedtext *    sharedtext
 

see Game Pattern

char* frdiGameSharedtextGetPadding frdi_app *    self,
frdi_game_sharedtext *    sharedtext
 

see Game Pattern

char* frdiGameSharedtextPaddingNew frdi_app *    self,
int    len
 

returns len characters of random text

frdi_game_plaintext* frdiGamePlaintextNew frdi_app *    self,
frdi_game_sharedtext *    sharedtext,
frdi_game_usertext *    usertext
 

see Game Pattern plaintext = sharedtext + usertext

frdi_game_plaintext* frdiGamePlaintextFromString frdi_app *    self,
char *    text
 

see Game Pattern

char* frdiGamePlaintextToString frdi_app *    self,
frdi_game_plaintext *    plaintext
 

see Game Pattern

frdi_game_sharedtext* frdiGamePlaintextGetSharedtext frdi_app *    self,
frdi_game_plaintext *    plaintext
 

see Game Pattern

frdi_game_usertext* frdiGamePlaintextGetUsertext frdi_app *    self,
frdi_game_plaintext *    plaintext
 

see Game Pattern

frdi_game_digest* frdiGamePlaintextGetDigest frdi_app *    self,
frdi_game_plaintext *    plaintext
 

see Game Pattern digest = hash ( plaintext )

int frdiGamePlaintextVerifyDigest frdi_app *    self,
frdi_game_plaintext *    plaintext,
frdi_game_digest *    digest
 

see Game Pattern returns 1 if it is the correct digest for this plaintext, 0 otherwise

frdi_game_properties* frdiGamePropertiesNew frdi_app *    self,
int    size,
frdi_game_modulo *    modulo,
frdi_game_sharedtext *    sharedtext
 

see Game Pattern

void frdiGamePropertiesSetModulo frdi_app *    self,
frdi_game_properties *    properties,
frdi_game_modulo *    modulo
 

see Game Pattern

void frdiGamePropertiesSetSharedtext frdi_app *    self,
frdi_game_properties *    properties,
frdi_game_sharedtext *    sharedtext
 

see Game Pattern

void frdiGamePropertiesSetSize frdi_app *    self,
frdi_game_properties *    properties,
int    size
 

see Game Pattern

frdi_game_modulo* frdiGamePropertiesGetModulo frdi_app *    self,
frdi_game_properties *    properties
 

see Game Pattern

frdi_game_sharedtext* frdiGamePropertiesGetSharedtext frdi_app *    self,
frdi_game_properties *    properties
 

see Game Pattern

int frdiGamePropertiesGetSize frdi_app *    self,
frdi_game_properties *    properties
 

see Game Pattern

char* frdiGamePropertiesDescribe frdi_app *    self,
frdi_game_properties *    properties
 

Describe the object note this is not 'ToString' as it is not reversible.

frdi_game_input* frdiGameInputNew frdi_app *    self,
frdi_game_usertext *    usertext,
frdi_game_modulo *    modulo
 

see Game Pattern input = ( usertext ) mod ( modulo )

frdi_game_input* frdiGameInputFromBigint frdi_app *    self,
frdi_bigint *    num
 

see Game Pattern

frdi_game_input* frdiGameInputFromString frdi_app *    self,
char *    text
 

see Game Pattern

frdi_bigint* frdiGameInputToBigint frdi_app *    self,
frdi_game_input *    input
 

see Game Pattern

char* frdiGameInputToString frdi_app *    self,
frdi_game_input *    input
 

see Game Pattern

frdi_game_output* frdiGameOutputNew frdi_app *    self,
frdi_game_properties *    properties,
frdi_list *    inputs
 

see Game Pattern

frdi_game_output* frdiGameOutputFromBigint frdi_app *    self,
frdi_bigint *    num
 

see Game Pattern

frdi_game_output* frdiGameOutputFromString frdi_app *    self,
char *    text
 

see Game Pattern

frdi_bigint* frdiGameOutputToBigint frdi_app *    self,
frdi_game_output *    output
 

see Game Pattern

char* frdiGameOutputToString frdi_app *    self,
frdi_game_output *    output
 

see Game Pattern


Generated on Wed Aug 18 13:23:58 2004 for Project Fairdice by doxygen1.2.18