#include <cybiko.h>
...
int index;
int record_number;
struct module_t main_module;
struct Score score_archive;
struct score_t* high_scores;
...
init_module( &main_module );
...
Score_ctor( &score_archive, main_module.m_process->module );
if( Score_is_valid ( &score_archive ) )
{
record_number = Score_get_record_count( &score_archive );
high_scores = (struct score_t*)malloc( sizeof(struct score_t)*record_number );
for( index = 0; index < record_number; index ++ )
{
Score_read( &score_archive, index, high_scores + index );
}
...
for( index = 0; index < record_number; index ++ )
{
Score_write_Ex( &score_archive,
index,
high_scores[index].score,
high_scores[index].nickname,
high_scores[index].cyid,
high_scores[index].time );
}
...
free(high_scores);
}
...
Score_dtor( &score_archive, LEAVE_MEMORY );
...