settings/src/iLiadPincodeData.h File Reference

settings - Pincode Data More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  sysPincodeSetting_t

Functions

void iLiad_pincode_data_init (void)
void iLiad_pincode_data_destroy (void)
gboolean iLiad_pincode_data_is_pincode_on (void)
void iLiad_pincode_data_set_pincode_on (gboolean enable)
unsigned char * iLiad_pincode_data_get_pincode (void)
void iLiad_pincode_data_set_pincode (const gchar *text)
void iLiad_pincode_data_store ()


Detailed Description

settings - Pincode Data

Copyright (C) 2005-2008 iRex Technologies B.V. All rights reserved.

in Pincode data of settings, read or write pincode data from sysset table

Definition in file iLiadPincodeData.h.


Function Documentation

void iLiad_pincode_data_destroy ( void   ) 

Definition at line 71 of file iLiadPincodeData.c.

00072 {
00073     if (g_current_pincode)
00074     {
00075         g_free(g_current_pincode);
00076         g_current_pincode = NULL;
00077     }
00078 
00079     if (g_stored_pincode)
00080     {
00081         g_free(g_stored_pincode);
00082         g_stored_pincode = NULL;
00083     }
00084 }

unsigned char* iLiad_pincode_data_get_pincode ( void   ) 

Definition at line 100 of file iLiadPincodeData.c.

00101 {
00102     if (NULL == g_current_pincode)
00103         return NULL;
00104     return g_current_pincode->pincode;
00105 }

void iLiad_pincode_data_init ( void   ) 

Definition at line 51 of file iLiadPincodeData.c.

00052 {
00053     iLiad_pincode_data_destroy();
00054 
00055     g_current_pincode = g_new0(sysPincodeSetting_t, 1);
00056     iLiad_pincode_data_read_pincode(g_current_pincode);
00057 
00058     if (NULL == g_current_pincode)
00059     {
00060         ST_WARNPRINTF("use default values");
00061         g_current_pincode = g_new0(sysPincodeSetting_t, 1);
00062         g_current_pincode->enable = FALSE;
00063         g_current_pincode->pincode[0] = '\0';
00064     }
00065     else
00066     {
00067         g_stored_pincode = pincode_setting_dup(g_current_pincode);
00068     }
00069 }

Here is the call graph for this function:

gboolean iLiad_pincode_data_is_pincode_on ( void   ) 

Definition at line 86 of file iLiadPincodeData.c.

00087 {
00088     if (NULL == g_current_pincode)
00089         return FALSE;
00090     return g_current_pincode->enable;
00091 }

void iLiad_pincode_data_set_pincode ( const gchar *  text  ) 

Definition at line 107 of file iLiadPincodeData.c.

00108 {
00109     int len;
00110     if (NULL == text)
00111         return;
00112     if (NULL == g_current_pincode)
00113         return;
00114     len = strlen(text);
00115     if (len > PINCODE_MAX_LENGTH)
00116         len = PINCODE_MAX_LENGTH;
00117     strncpy(g_current_pincode->pincode, text, len);
00118 }

void iLiad_pincode_data_set_pincode_on ( gboolean  enable  ) 

Definition at line 93 of file iLiadPincodeData.c.

00094 {
00095     if (NULL == g_current_pincode)
00096         return;
00097     g_current_pincode->enable = enable;
00098 }

void iLiad_pincode_data_store (  ) 

Definition at line 150 of file iLiadPincodeData.c.

00151 {
00152     if ((NULL == g_current_pincode) || (NULL == g_stored_pincode))
00153         return;
00154 
00155     if ((g_current_pincode->enable != g_stored_pincode->enable)
00156         || (0 != strcmp(g_current_pincode->pincode, g_stored_pincode->pincode)))
00157     {
00158         iLiad_pincode_data_write_pincode(g_current_pincode);
00159 
00160         if (g_stored_pincode->enable != g_current_pincode->enable)
00161             g_stored_pincode->enable = g_current_pincode->enable;
00162 
00163         if (strcmp(g_current_pincode->pincode, g_stored_pincode->pincode))
00164             strcpy(g_stored_pincode->pincode, g_current_pincode->pincode);
00165     }
00166 }

Here is the call graph for this function:


Generated on Sun Dec 14 17:17:17 2008 by  doxygen 1.5.6