This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

prefs.c File Reference

#include <time.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>
#include "prefs.h"
#include "ui_common.h"

Go to the source code of this file.

Functions

void prefs_strip_special_chars (gchar *str)
gboolean prefs_create_dir (gchar *dir)
gboolean prefs_first_time ()
gboolean prefs_load_scores (gchar *name)
void prefs_show_scores_real (int index)
void prefs_show_scores ()
gboolean prefs_save_scores (gchar *name)
int prefs_scorecmp_dscore (gchar *score1, int temps1, gchar *score2, int temps2)
int prefs_scorecmp_iscore (gchar *score1, int temps1, gchar *score2, int temps2)
int prefs_scorecmp_time (gchar *score1, int temps1, gchar *score2, int temps2)
void prefs_username_cb (GtkWidget *dialog, GtkEntry *entry)
void prefs_show_username_dialog ()
void prefs_add_highscore (gchar *score, int temps)
void prefs_zap_highscores ()

Variables

Score scores [MAX_HIGHSCORES]
int num_highscores = 0
gchar* gamename
SCORE_FIELD prefs_score_fields_def []
gchar* prefs_score_field_names_def [] = {"User", "Score", "Time", "Date", NULL}
int highscore_temps
int highscore_index
int highscore_date
gchar highscore_score [32]


Function Documentation

void prefs_add_highscore ( gchar * score,
int temps )
 

Definition at line 376 of file prefs.c.

gboolean prefs_create_dir ( gchar * dir ) [static]
 

Definition at line 48 of file prefs.c.

Referenced by prefs_first_time().

gboolean prefs_first_time ( ) [static]
 

Definition at line 63 of file prefs.c.

Referenced by prefs_load_scores(), and prefs_save_scores().

gboolean prefs_load_scores ( gchar * name )
 

Definition at line 85 of file prefs.c.

gboolean prefs_save_scores ( gchar * name )
 

Definition at line 249 of file prefs.c.

int prefs_scorecmp_dscore ( gchar * score1,
int temps1,
gchar * score2,
int temps2 )
 

Definition at line 285 of file prefs.c.

int prefs_scorecmp_iscore ( gchar * score1,
int temps1,
gchar * score2,
int temps2 )
 

Definition at line 296 of file prefs.c.

int prefs_scorecmp_time ( gchar * score1,
int temps1,
gchar * score2,
int temps2 )
 

Definition at line 307 of file prefs.c.

void prefs_show_scores ( )
 

Definition at line 242 of file prefs.c.

void prefs_show_scores_real ( int index ) [static]
 

Definition at line 141 of file prefs.c.

Referenced by prefs_show_scores(), and prefs_username_cb().

void prefs_show_username_dialog ( )
 

Definition at line 337 of file prefs.c.

Referenced by prefs_add_highscore().

void prefs_strip_special_chars ( gchar * str ) [static]
 

Definition at line 39 of file prefs.c.

Referenced by prefs_add_highscore(), and prefs_username_cb().

void prefs_username_cb ( GtkWidget * dialog,
GtkEntry * entry ) [static]
 

Definition at line 317 of file prefs.c.

Referenced by prefs_show_username_dialog().

void prefs_zap_highscores ( )
 

Definition at line 397 of file prefs.c.


Variable Documentation

gchar* gamename [static]
 

Definition at line 32 of file prefs.c.

int highscore_date [static]
 

Definition at line 314 of file prefs.c.

int highscore_index [static]
 

Definition at line 314 of file prefs.c.

gchar highscore_score[32] [static]
 

Definition at line 315 of file prefs.c.

int highscore_temps [static]
 

Definition at line 314 of file prefs.c.

int num_highscores = 0 [static]
 

Definition at line 31 of file prefs.c.

gchar* prefs_score_field_names_def[] = {"User", "Score", "Time", "Date", NULL}
 

Definition at line 37 of file prefs.c.

SCORE_FIELD prefs_score_fields_def[]
 

Initial value:

 
{SCORE_FIELD_USER, SCORE_FIELD_SCORE, SCORE_FIELD_TIME, SCORE_FIELD_DATE, SCORE_FIELD_NONE}

Definition at line 34 of file prefs.c.

Score scores[MAX_HIGHSCORES] [static]
 

Definition at line 30 of file prefs.c.