00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #ifndef _FRDI_GAME_H
00033 #define _FRDI_GAME_H
00034
00035
00038 char *frdiGameParseGameId(frdi_app *self, frdi_message *message);
00039
00042 frdi_list *frdiGameParseGameIdParts(frdi_app *self, char *game_id);
00043
00046 char *frdiGameParseGameMessage(frdi_app *self, frdi_message *message);
00047
00050 frdi_list *frdiGameRangeToList(frdi_app *self, char *range);
00051
00054 char *frdiGameListToRange(frdi_app *self, frdi_list *user_ids);
00055
00056
00057
00060 frdi_game_modulo *frdiGameModuloFromBigint(frdi_app *self, frdi_bigint *num);
00061
00064 frdi_game_modulo *frdiGameModuloFromString(frdi_app *self, char *text);
00065
00068 frdi_bigint *frdiGameModuloToBigint(frdi_app *self, frdi_game_modulo *modulo);
00069
00072 char *frdiGameModuloToString(frdi_app *self, frdi_game_modulo *modulo);
00073
00074
00075
00076
00079 frdi_game_usertext *frdiGameUsertextNew(frdi_app *self, frdi_game_modulo *modulo);
00080
00083 frdi_game_usertext *frdiGameUsertextFromBigint(frdi_app *self, frdi_bigint *num);
00084
00087 frdi_game_usertext *frdiGameUsertextFromString(frdi_app *self, char *text);
00088
00091 frdi_bigint *frdiGameUsertextToBigint(frdi_app *self, frdi_game_usertext *usertext);
00092
00095 char *frdiGameUsertextToString(frdi_app *self, frdi_game_usertext *usertext);
00096
00097
00098
00099
00102 frdi_game_digest *frdiGameDigestFromBigint(frdi_app *self, frdi_bigint *num);
00103
00106 frdi_game_digest *frdiGameDigestFromString(frdi_app *self, char *text);
00107
00110 frdi_bigint *frdiGameDigestToBigint(frdi_app *self, frdi_game_digest *digest);
00111
00114 char *frdiGameDigestToString(frdi_app *self, frdi_game_digest *digest);
00115
00118 int frdiGameDigestIsEqual(frdi_app *self, frdi_game_digest *one, frdi_game_digest *two);
00119
00120
00121
00122
00126 frdi_game_sharedtext *frdiGameSharedtextNew(frdi_app *self, char *hostid, char *gameid, char *timeid);
00127
00130 frdi_game_sharedtext *frdiGameSharedtextFromString(frdi_app *self, char *text);
00131
00134 char *frdiGameSharedtextToString(frdi_app *self, frdi_game_sharedtext *sharedtext);
00135
00138 char *frdiGameSharedtextGetHostid(frdi_app *self, frdi_game_sharedtext *sharedtext);
00139
00142 char *frdiGameSharedtextGetGameid(frdi_app *self, frdi_game_sharedtext *sharedtext);
00143
00146 char *frdiGameSharedtextGetTimeid(frdi_app *self, frdi_game_sharedtext *sharedtext);
00147
00150 char *frdiGameSharedtextGetPadding(frdi_app *self, frdi_game_sharedtext *sharedtext);
00151
00154 char *frdiGameSharedtextPaddingNew(frdi_app *self, int len);
00155
00156
00157
00158
00161 frdi_game_plaintext *frdiGamePlaintextNew(frdi_app *self, frdi_game_sharedtext *sharedtext, frdi_game_usertext *usertext);
00162
00165 frdi_game_plaintext *frdiGamePlaintextFromString(frdi_app *self, char *text);
00166
00169 char *frdiGamePlaintextToString(frdi_app *self, frdi_game_plaintext *plaintext);
00170
00173 frdi_game_sharedtext *frdiGamePlaintextGetSharedtext(frdi_app *self, frdi_game_plaintext *plaintext);
00174
00177 frdi_game_usertext *frdiGamePlaintextGetUsertext(frdi_app *self, frdi_game_plaintext *plaintext);
00178
00181 frdi_game_digest *frdiGamePlaintextGetDigest(frdi_app *self, frdi_game_plaintext *plaintext);
00182
00185 int frdiGamePlaintextVerifyDigest(frdi_app *self, frdi_game_plaintext *plaintext, frdi_game_digest *digest);
00186
00187
00188
00189
00192 frdi_game_properties *frdiGamePropertiesNew(frdi_app *self, int size, frdi_game_modulo *modulo, frdi_game_sharedtext *sharedtext);
00193
00196 void frdiGamePropertiesSetModulo(frdi_app *self, frdi_game_properties *properties, frdi_game_modulo *modulo);
00197
00200 void frdiGamePropertiesSetSharedtext(frdi_app *self, frdi_game_properties *properties, frdi_game_sharedtext *sharedtext);
00201
00204 void frdiGamePropertiesSetSize(frdi_app *self, frdi_game_properties *properties, int size);
00205
00208 frdi_game_modulo *frdiGamePropertiesGetModulo(frdi_app *self, frdi_game_properties *properties);
00209
00212 frdi_game_sharedtext *frdiGamePropertiesGetSharedtext(frdi_app *self, frdi_game_properties *properties);
00213
00216 int frdiGamePropertiesGetSize(frdi_app *self, frdi_game_properties *properties);
00217
00220 char * frdiGamePropertiesDescribe(frdi_app *self, frdi_game_properties *properties);
00221
00222
00223
00224
00227 frdi_game_input *frdiGameInputNew(frdi_app *self, frdi_game_usertext *usertext, frdi_game_modulo *modulo);
00228
00231 frdi_game_input *frdiGameInputFromBigint(frdi_app *self, frdi_bigint *num);
00232
00235 frdi_game_input *frdiGameInputFromString(frdi_app *self, char *text);
00236
00239 frdi_bigint *frdiGameInputToBigint(frdi_app *self, frdi_game_input *input);
00240
00243 char *frdiGameInputToString(frdi_app *self, frdi_game_input *input);
00244
00245
00246
00247
00250 frdi_game_output *frdiGameOutputNew(frdi_app *self, frdi_game_properties *properties, frdi_list *inputs);
00251
00254 frdi_game_output *frdiGameOutputFromBigint(frdi_app *self, frdi_bigint *num);
00255
00258 frdi_game_output *frdiGameOutputFromString(frdi_app *self, char *text);
00259
00262 frdi_bigint *frdiGameOutputToBigint(frdi_app *self, frdi_game_output *output);
00263
00266 char *frdiGameOutputToString(frdi_app *self, frdi_game_output *output);
00267
00268
00269 #endif
00270
00271