summaryrefslogtreecommitdiff
path: root/src/server/highScore.c
diff options
context:
space:
mode:
authorDusan Durech <dusan@debian.debian>2009-04-12 14:29:51 +0200
committerDusan Durech <dusan@debian.debian>2009-04-12 14:29:51 +0200
commit876fc624df9728ee0feee26e1b31b53ed9ef3326 (patch)
treee20814ab6d07fb892284dcee11bc492532bdabaa /src/server/highScore.c
parentdff1cbc31ca8d585c01f5bebd08e50cf07fd2b0c (diff)
convert all name function from oldName to new_name
Diffstat (limited to 'src/server/highScore.c')
-rw-r--r--src/server/highScore.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/server/highScore.c b/src/server/highScore.c
index 89476ff..affd28f 100644
--- a/src/server/highScore.c
+++ b/src/server/highScore.c
@@ -11,16 +11,16 @@
static textFile_t *textFile;
-void initHighScore(char *file)
+void highScore_init(char *file)
{
int i;
- textFile = loadTextFile(file);
+ textFile = textFile_load(file);
if (textFile == NULL) {
fprintf(stderr, _("I am unable to load: \"%s\"!\n"), file);
fprintf(stderr, _("Creating: \"%s\"\n"), file);
- textFile = newTextFile(file);
+ textFile = textFile_new(file);
} else {
DEBUG_MSG(_("Scorefile: \"%s\"\n"), file);
@@ -33,13 +33,13 @@ void initHighScore(char *file)
}
for (i = 0; i < HIGHSCORE_MAX_PLAYERS; i++) {
- addList(textFile->text, strdup("no_name 0"));
+ list_add(textFile->text, strdup("no_name 0"));
}
- saveTextFile(textFile);
+ textFile_save(textFile);
}
-int addPlayerInHighScore(char *name, int score)
+int table_add(char *name, int score)
{
int i;
@@ -59,10 +59,10 @@ int addPlayerInHighScore(char *name, int score)
char new[STR_SIZE];
sprintf(new, "%s %d", name, score);
- insList(textFile->text, i, strdup(new));
- delListItem(textFile->text, HIGHSCORE_MAX_PLAYERS, free);
- //printTextFile(textFile);
- saveTextFile(textFile);
+ list_ins(textFile->text, i, strdup(new));
+ list_del_item(textFile->text, HIGHSCORE_MAX_PLAYERS, free);
+ //textFile_print(textFile);
+ textFile_save(textFile);
return 0;
}
@@ -71,7 +71,7 @@ int addPlayerInHighScore(char *name, int score)
return -1;
}
-char *getTableItem(int index)
+char *highScore_get_table(int index)
{
if (textFile != NULL && index >= 0 && index < textFile->text->count) {
return (char *) textFile->text->list[index];
@@ -80,10 +80,10 @@ char *getTableItem(int index)
return NULL;
}
-void quitHighScore()
+void highScore_quit()
{
if (textFile != NULL) {
- saveTextFile(textFile);
- destroyTextFile(textFile);
+ textFile_save(textFile);
+ textFile_destroy(textFile);
}
}