head 1.1; branch 1.1.1; access ; symbols start:1.1.1.1 PAlibDoc:1.1.1; locks ; strict; comment @# @; 1.1 date 2005.11.02.08.30.32; author jandujar; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2005.11.02.08.30.32; author jandujar; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @ PA_lib: Fichier source de PA_GBFS.h

PA_GBFS.h

Aller à la documentation de ce fichier.
00001 #ifndef _PA_GBFS
00002 #define _PA_GBFS
00003 
00004 
00010 #include "PA_Text.h"
00011 #include "gbfs.h"
00012 
00013 
00014 
00015 
00016 typedef struct{
00017        void *File; // Position du fichier...
00018        char Name[30]; // Nom du fichier, sans extension
00019        char Ext[6]; // Extension du fichier !
00020        u32 Length; // Longueur
00021 } PA_GBFS_infos;
00022 extern PA_GBFS_infos PA_GBFSfile[200]; 
00023 extern s16 PA_GBFS_nfiles;
00024 extern GBFS_FILE const* PA_GBFS_FILE;
00025 
00036 extern inline u32 PA_InitGBFS(void){
00037 s16 dot = 0;
00038 s16 i = 0;
00039 
00040        WAIT_CR &= ~0x80;
00041  
00042        PA_GBFS_FILE = find_first_gbfs_file((void*)0x08000000);
00043        PA_GBFS_nfiles = 0;
00044        PA_GBFSfile[PA_GBFS_nfiles].File = (void*)gbfs_get_nth_obj(PA_GBFS_FILE, PA_GBFS_nfiles, (char*)PA_GBFSfile[PA_GBFS_nfiles].Name, &PA_GBFSfile[PA_GBFS_nfiles].Length);
00045 
00046 while(PA_GBFSfile[PA_GBFS_nfiles].File != NULL){
00047 
00048        // On cherche la fin du nom
00049        while(PA_GBFSfile[PA_GBFS_nfiles].Name[i]) i++;
00050        // On en déduit le dernier point, pour avoir l'extension
00051        while(PA_GBFSfile[PA_GBFS_nfiles].Name[i] != '.') i--; // On cherche l'extension
00052        dot = i+1;
00053        
00054        for (i = 0; PA_GBFSfile[PA_GBFS_nfiles].Name[i+dot] ; i++){
00055               PA_GBFSfile[PA_GBFS_nfiles].Ext[i] = PA_GBFSfile[PA_GBFS_nfiles].Name[i+dot];
00056               if (('A' <= PA_GBFSfile[PA_GBFS_nfiles].Ext[i])&&(PA_GBFSfile[PA_GBFS_nfiles].Ext[i] <= 'Z')) PA_GBFSfile[PA_GBFS_nfiles].Ext[i] += 'a' - 'A'; // On passe en minuscule
00057               PA_GBFSfile[PA_GBFS_nfiles].Ext[i+1] = 0;
00058               PA_GBFSfile[PA_GBFS_nfiles].Name[i+dot-1] = 0;
00059               if (PA_GBFSfile[PA_GBFS_nfiles].Name[i+dot-2] == '.') PA_GBFSfile[PA_GBFS_nfiles].Name[i+dot-2] = 0;
00060        }
00061        PA_GBFSfile[PA_GBFS_nfiles].Name[dot] = 0;
00062        PA_GBFSfile[PA_GBFS_nfiles].Ext[dot] = 0;
00063        
00064        ++PA_GBFS_nfiles; // On ajoute un objet...
00065        PA_GBFSfile[PA_GBFS_nfiles].File = (void*)gbfs_get_nth_obj(PA_GBFS_FILE, PA_GBFS_nfiles, (char*)PA_GBFSfile[PA_GBFS_nfiles].Name, &PA_GBFSfile[PA_GBFS_nfiles].Length);
00066 }
00067 
00068 return PA_GBFS_nfiles;
00069 }
00070 
00071 
00072 
00087 extern inline s32 PA_GetGBFSFile(s16 start, char *name, char *extension){
00088 s16 i;
00089 
00090 for (i = start; i < PA_GBFS_nfiles; i++){
00091        if (PA_CompareText(PA_GBFSfile[i].Name, name)&& PA_CompareText(PA_GBFSfile[i].Ext, extension)) 
00092               return i;
00093 }
00094 
00095 return -1;
00096 }
00097 
00098 
00110 s16 PA_GBFSSearchExt(s16 *array, char *extension);
00111 
00112  // end of GBFS
00114 
00115 
00116 
00117 #endif
00118 
00119 

Généré le Fri Oct 28 23:18:12 2005 pour PA_lib par  doxygen 1.3.9.1
@ 1.1.1.1 log @Initial import of PalibDoc, begin on PAlib0.64b @ text @@