loadhashtableslocalization.h File Reference

#include "machine.h"

Include dependency graph for loadhashtableslocalization.h:

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

Go to the source code of this file.

Functions

BOOL LoadHashTablesLocalization (char *language)


Function Documentation

BOOL LoadHashTablesLocalization ( char *  language  ) 

load hash tables for localization

Definition at line 23 of file loadhashtableslocalization.c.

References FALSE, FILEERRORS, FileExist(), FILEFORMATPATH, FILEMENUS, FILEMSGS, FREE, GetHashTableScilabErrors(), GetHashTableScilabMenus(), GetHashTableScilabMessages(), getmodules(), getSCIpath(), i, LoadHashTableLocalization(), MALLOC, MODULESLIST::ModuleList, NULL, MODULESLIST::numberofModules, and TRUE.

Referenced by InitializeLocalization(), and setlanguage().

00024 {
00025         BOOL bOK=FALSE;
00026         char *SciPath=NULL;
00027         int i=0;
00028 
00029         struct hashtable *Table_Errors=NULL;
00030         struct hashtable *Table_Messages=NULL;
00031         struct hashtable *Table_Menus=NULL;
00032 
00033         struct MODULESLIST *moduleslist=NULL;
00034         moduleslist=getmodules();
00035 
00036         Table_Errors=GetHashTableScilabErrors();        
00037         Table_Messages=GetHashTableScilabMessages();    
00038         Table_Menus=GetHashTableScilabMenus();  
00039 
00040         SciPath=getSCIpath();
00041         
00042         for(i=0;i<moduleslist->numberofModules;i++)
00043         {
00044                 char *full_filename_errors=NULL;
00045                 char *full_filename_messages=NULL;
00046                 char *full_filename_menus=NULL;
00047 
00048                 full_filename_errors=(char*)MALLOC(sizeof(char)*(strlen(SciPath)+strlen(FILEFORMATPATH)+strlen(moduleslist->ModuleList[i])+strlen(FILEERRORS)+strlen(language)+1));
00049                 full_filename_messages=(char*)MALLOC(sizeof(char)*(strlen(SciPath)+strlen(FILEFORMATPATH)+strlen(moduleslist->ModuleList[i])+strlen(FILEMSGS)+strlen(language)+1));
00050                 full_filename_menus=(char*)MALLOC(sizeof(char)*(strlen(SciPath)+strlen(FILEFORMATPATH)+strlen(moduleslist->ModuleList[i])+strlen(FILEMENUS)+strlen(language)+1));
00051 
00052                 sprintf(full_filename_errors,FILEFORMATPATH,SciPath,moduleslist->ModuleList[i],language,FILEERRORS);
00053                 sprintf(full_filename_messages,FILEFORMATPATH,SciPath,moduleslist->ModuleList[i],language,FILEMSGS);
00054                 sprintf(full_filename_menus,FILEFORMATPATH,SciPath,moduleslist->ModuleList[i],language,FILEMENUS);
00055 
00056                 if (FileExist(full_filename_errors)) LoadHashTableLocalization(Table_Errors,full_filename_errors);
00057                 if (FileExist(full_filename_messages)) LoadHashTableLocalization(Table_Messages,full_filename_messages);
00058                 if (FileExist(full_filename_menus)) LoadHashTableLocalization(Table_Menus,full_filename_menus);
00059 
00060                 if (full_filename_errors) {FREE(full_filename_errors);full_filename_errors=NULL;}
00061                 if (full_filename_messages) {FREE(full_filename_messages);full_filename_messages=NULL;}
00062                 if (full_filename_menus) {FREE(full_filename_menus);full_filename_menus=NULL;}
00063                 bOK=TRUE;
00064         }
00065 
00066         if (SciPath) {FREE(SciPath); SciPath=NULL;}
00067 
00068         return bOK;
00069 }

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Sun Mar 4 16:10:11 2007 for Scilab [trunk] by  doxygen 1.5.1