00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 void MakeTableClasses(){
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 Char_t *libs[] = {"St_base"};
00025 Char_t *suffix=0;
00026 Int_t nlist = 1;
00027 Bool_t NT=kFALSE;
00028 if (strcmp(gSystem.GetName(),"WinNT") == 0 ) {
00029 NT = kTRUE;
00030
00031 suffix = ".dll";
00032 }
00033 else
00034 suffix =".so";
00035
00036 Char_t buffer[256];
00037 for(Int_t i=0;i<nlist;i++) {
00038 strcpy(buffer,libs[i]);strcat(buffer,suffix);
00039 if (gSystem.Load(buffer)) printf(" Loading DLL \"%s\" failed \n",buffer);
00040 }
00041
00042 void *dirhandle = 0;
00043 char *sourcedir = 0;
00044 if (NT)
00045 sourcedir = "//sol/afs_rhic/star/packages/dev/.share/tables";
00046 else
00047 sourcedir = "/afs/rhic.bnl.gov/star/packages/dev/.share/tables";
00048 NT = kFALSE;
00049 dirhandle = gSystem->OpenDirectory(sourcedir);
00050 if (dirhandle) {
00051 char *na = 0;
00052 Int_t count=0;
00053 Char_t name[200];
00054 Char_t *structname = 0;
00055 while (na = gSystem->GetDirEntry(dirhandle) && count < 999993) {
00056 char *dot = 0;
00057 strcpy(name,na);
00058 if (!strstr(name,"St_") && (dot = strstr(name,".h")) ){
00059 Char_t *filename = gSystem->ConcatFileName(sourcedir,name);
00060 printf("G__loadfile(\"%s\");\n",filename);
00061 G__loadfile(filename);
00062 *dot = 0;
00063 structname = strrchr(name,'/');
00064
00065 if (structname)
00066 structname++;
00067 else if (structname = strrchr(name,':'))
00068 structname++;
00069 else
00070 structname = name;
00071
00072 printf("St_Table tabs(\"%s\",1);\n",structname);
00073 printf("tabs.StafStreamer();\n");
00074 St_Table *tablest = new St_Table(structname,1);
00075 if (tablest) {
00076
00077 delete tablest;
00078 count++;
00079 }
00080 else
00081 printf(" CINT Error. The \"%s\" was not done!\n",structname);
00082 if (filename) delete [] filename;
00083 }
00084 }
00085 printf(" %d files have been converted\n",count);
00086 }
00087 }