static PRBool wallet_tablesInitialized = PR_FALSE; static PRBool wallet_ValuesReadIn = PR_FALSE; static PRBool namesInitialized = PR_FALSE;
wallet_Initialize(PRBool unlockDatabase=PR_TRUE) {  static PRBool wallet_tablesInitialized = PR_FALSE;  static PRBool wallet_ValuesReadIn = PR_FALSE;  static PRBool namesInitialized = PR_FALSE;#ifdef DEBUG//wallet_ClearStopwatch();//wallet_ResumeStopwatch();#endif  if (!wallet_tablesInitialized) {#ifdef DEBUG//wallet_PauseStopwatch();//wallet_DumpStopwatch();#endif//    printf("******** start profile\n");//             ProfileStart();    Wallet_ReleaseAllLists();    helpMac = new wallet_HelpMac; /* to speed up startup time on the mac */#ifdef AutoCapture    wallet_ReadFromFile(distinguishedSchemaFileName, wallet_DistinguishedSchema_list, PR_FALSE);#endif    wallet_ReadFromFile(fieldSchemaFileName, wallet_FieldToSchema_list, PR_FALSE);    wallet_ReadFromFile(vcardSchemaFileName, wallet_VcardToSchema_list, PR_FALSE);    wallet_ReadFromFile(schemaConcatFileName, wallet_SchemaConcat_list, PR_FALSE);    wallet_ReadFromFile(schemaStringsFileName, wallet_SchemaStrings_list, PR_FALSE, BY_LENGTH);    wallet_ReadFromFile(positionalSchemaFileName, wallet_PositionalSchema_list, PR_FALSE);    wallet_ReadFromFile(stateSchemaFileName, wallet_StateSchema_list, PR_FALSE);    /* Note that we sort the SchemaString list by length instead of alphabetically.  To see     * why that's necessary, consider the following example:     *     *    Card.Name: requires "card" and "name" both be present     *    Name: requires "name"     *     * So we want to check for a match on one with more strings (Card.Name in this case) before     * checking for a match with the one containing less strings.     */ //    ProfileStop();//   printf("****** end profile\n");    wallet_tablesInitialized = PR_TRUE;  }  if (!unlockDatabase) {    return;  }  if (!namesInitialized) {    SI_GetCharPref(pref_WalletSchemaValueFileName, &schemaValueFileName);    if (!schemaValueFileName) {      schemaValueFileName = Wallet_RandomName("w");      SI_SetCharPref(pref_WalletSchemaValueFileName, schemaValueFileName);    }    SI_InitSignonFileName();    namesInitialized = PR_TRUE;  }  if (!wallet_ValuesReadIn) {    wallet_Clear(&wallet_SchemaToValue_list); /* otherwise we will duplicate the list */    wallet_ReadFromFile(schemaValueFileName, wallet_SchemaToValue_list, PR_TRUE);    wallet_ValuesReadIn = PR_TRUE;  }#if DEBUG//    fprintf(stdout,"Field to Schema table \n");//    wallet_Dump(wallet_FieldToSchema_list);//    fprintf(stdout,"Vcard to Schema table \n");//    wallet_Dump(wallet_VcardToSchema_list);//    fprintf(stdout,"SchemaConcat table \n");//    wallet_Dump(wallet_SchemaConcat_list);//    fprintf(stdout,"SchemaStrings table \n");//    wallet_Dump(wallet_SchemaStrings_list);//    fprintf(stdout,"PositionalSchema table \n");//    wallet_Dump(wallet_PositionalSchema_list);//    fprintf(stdout,"StateSchema table \n");//    wallet_Dump(wallet_StateSchema_list);//    fprintf(stdout,"Schema to Value table \n");//    wallet_Dump(wallet_SchemaToValue_list);#endif}