| 352 | } |
| 353 | |
| 354 | S32 xSGAddSaveClient(st_XSAVEGAME_DATA* xsgdata, U32 clttag, void* cltdata, |
| 355 | S32 (*infofunc)(void*, st_XSAVEGAME_DATA*, S32*, S32*), |
| 356 | S32 (*procfunc)(void*, st_XSAVEGAME_DATA*, st_XSAVEGAME_WRITECONTEXT*)) |
| 357 | { |
| 358 | S32 result = 1; |
| 359 | if (xsgdata->stage & 0x40000000) |
| 360 | { |
| 361 | result = 0; |
| 362 | } |
| 363 | else if (!(xsgdata->stage & 1)) |
| 364 | { |
| 365 | result = 0; |
| 366 | } |
| 367 | |
| 368 | if (xsgdata->stkcnt + 1 >= 128) |
| 369 | { |
| 370 | xUtil_idtag2string(clttag, 0); |
| 371 | result = 0; |
| 372 | } |
| 373 | |
| 374 | st_XSAVEGAME_CLIENT* clt = &xsgdata->cltstk[xsgdata->stkcnt++]; |
| 375 | clt->idtag = clttag; |
| 376 | clt->cltinfo = infofunc; |
| 377 | clt->cltproc = procfunc; |
| 378 | clt->cltdata = cltdata; |
| 379 | clt->needamt = 0; |
| 380 | clt->realamt = 0; |
| 381 | clt->buf_sizepos = NULL; |
| 382 | |
| 383 | xsgdata->stage |= 4; |
| 384 | if (result == 0) |
| 385 | { |
| 386 | xsgdata->stage |= 0x40000000; |
| 387 | } |
| 388 | return result; |
| 389 | } |
| 390 | |
| 391 | S32 xSGAddLoadClient(st_XSAVEGAME_DATA* xsgdata, U32 clttag, void* cltdata, |
| 392 | S32 (*loadfunc)(void*, st_XSAVEGAME_DATA*, st_XSAVEGAME_READCONTEXT*, |
no test coverage detected