#define EQ(A,B) !strcmp((A),(B))
#define MEMSIZE 0x10000
+//#define DODUMP 1
typedef struct
{
void SaveLinkedFilePath(char * filepath)
{
int j;
-
+
if(dflag)
{
infn=realloc(infn, sizeof(_infn)*(numin+1));
GetName(infn[numin].PathName, infn[numin].ModuleName);
//printf("%s, %s\n", infn[numin].PathName, infn[numin].ModuleName);
- numin++;
+ /*Check if this filename is already in*/
+ for(j=0; j<numin; j++)
+ {
+ if(EQ(infn[numin].PathName, infn[j].PathName)) break;
+ }
+ if(j==numin) numin++;
}
}
GlobalChkSum=0;
}
+#ifdef DODUMP
void DumpForDebug (void)
{
char DumpFileName[PATH_MAX];
fclose(DumpFile);
}
+#endif
void OutputAOEMF51(void)
{
if(CDBin==NULL)
{
printf("Couldn't open file '%s'\n", SourceName);
+ lkexit(1);
}
CurrentModule=0; /*Set the active module as the first one*/
break;
}
}
+
+ /*It could be also a static function*/
+ for(j=0; j<numproc; j++)
+ {
+ if(EQ(procedure[j].name, name))
+ {
+ if( (procedure[j].BeginAdd==-1) ) procedure[j].BeginAdd=Address;
+ break;
+ }
+ }
+
break;
case 'L': /*Example L:Lmain$j$1$1:29*/
if(dflag)
{
CollectInfoFromCDB();
- //DumpForDebug();
+ #ifdef DODUMP
+ DumpForDebug();
+ #endif
HexSize=ReadHexFile(&HexBegin)+1;
OutputAOEMF51();
FreeAll();
if (dflag && dfp) {
FILE *xfp = afile(str,"adb",0); //JCF: Nov 30, 2002
if (xfp) {
+ SaveLinkedFilePath(str);
copyfile(dfp,xfp);
fclose(xfp);
}
if (dflag){
//dfp = afile("temp", "cdb", 1);
+ SaveLinkedFilePath(linkp->f_idp); //Must be the first one...
dfp = afile(linkp->f_idp,"cdb",1); //JCF: Nov 30, 2002
if (dfp == NULL)
lkexit(1);