#include #include #include #include #include "general.h" extern FILE* logFile; #define PLATFORM_COUNT 2 #define X86_PLATFORM 1 // index #2 into PSTR's below. PSTR GenericSubstitutions[PLATFORM_COUNT] = { "alpha","i386" }; PSTR PlatformSubstitutions[PLATFORM_COUNT] = { "alpha", "x86" }; PSTR AclpathSubstitutions[PLATFORM_COUNT] = { "w32alpha","w32x86" }; typedef struct _TRACKED_STRING { struct _TRACKED_STRING *Next; PSTR String; } TRACKED_STRING, *PTRACKED_STRING; PTRACKED_STRING SourceFieldStrings; PTRACKED_STRING PathFieldStrings; PTRACKED_STRING PlatformFieldStrings; PTRACKED_STRING CdPathFieldStrings; PTRACKED_STRING InfFileFieldStrings; PTRACKED_STRING InfSectionFieldStrings; PTRACKED_STRING AclPathFieldStrings; VOID ExpandField( IN OUT PSTR *Field, IN PSTR SubstituteText, IN OUT PTRACKED_STRING *StringList ) { unsigned c; PSTR p; CHAR buf[1000]; PTRACKED_STRING s; if(p = strchr(*Field,'@')) { c = (unsigned)(p - (*Field)); // // Create the platform-specific string. // strncpy(buf,*Field,c); buf[c] = 0; strcat(buf,SubstituteText); strcat(buf,(*Field) + c + 1); } else { // // No @, field doesn't need to change. // return; } // // See whether we already have this string. // s = *StringList; while(s) { if(!_stricmp(buf,s->String)) { *Field = s->String; return; } s = s->Next; } // // We don't already have it. Create it. // s = malloc(sizeof(TRACKED_STRING)); if(!s) { PRINT1("ERROR Couldn't allocate enough memory.\n") exit(1); } s->String = _strdup(buf); if(!s->String) { PRINT1("ERROR Couldn't allocate enough memory.\n") exit(1); } *Field = s->String; s->Next = *StringList; *StringList = s; } VOID ExpandPlatformIndependentEntry( IN OUT Entry *e, IN int FirstRecord ) { int i,j; Entry t; t = *(e+FirstRecord); for(i=0,j=FirstRecord; iname); fprintf(f,"%s\t",entry->source); fprintf(f,"%s\t",entry->path); fprintf(f,"%s\t",entry->flopmedia); fprintf(f,"%s\t",entry->comment); fprintf(f,"%s\t",entry->product); fprintf(f,"%s\t",entry->sdk); fprintf(f,"%s\t",entry->platform); fprintf(f,"%s\t",entry->cdpath); fprintf(f,"%s\t",entry->inf); fprintf(f,"%s\t",entry->section); fprintf(f,"%s\t",entry->infline); fprintf(f,"%d\t",entry->size); fprintf(f,"%d\t",entry->csize); fprintf(f,"%s\t",entry->nocompress); fprintf(f,"%d\t",entry->priority); fprintf(f,"%s\t",entry->lmacl); fprintf(f,"%s\t",entry->ntacl); fprintf(f,"%s\t",entry->aclpath); fprintf(f,"%s\t",entry->medianame); fprintf(f,"%d\r\n",entry->disk); } int EntryMatchProduct(entry,product) Entry* entry; char* product; { if (!_stricmp(product,"ALL")) return(1); return // // Laying out NT floppies AND entry is not for AS-only // AND entry specifies that this file goes on floppy // (!_stricmp(product,"NTFLOP") // include X86 floppy files && _stricmp(entry->product,"as") // exclude AS only files && (entry->priority < 1000) // include prioty < 1000 && _stricmp(entry->source,"alphabins") // exclude alphabins files && _stricmp(entry->path,"\\alpha") // exclude alpha path files && _stricmp(entry->source,"alphadbg") // exclude alphadbg files && _stricmp(entry->source,"x86dbg") // exclude x86dbg files ) // // Laying out AS floppies AND entry is not for NT-only // AND entry specified that this file goes on floppy // || (!_stricmp(product,"LMFLOP") && _stricmp(entry->product,"nt") // exclude NT only files && (entry->priority < 1000) && _stricmp(entry->source,"alphabins") && _stricmp(entry->path,"\\alpha") && _stricmp(entry->source,"alphadbg") && _stricmp(entry->source,"x86dbg") ) // // Laying out nt cd-rom and entry is not for as only // || (!_stricmp(product,"NTCD") && _stricmp(entry->product,"as")) // // Laying out as cd-rom and entry is not for nt only // || (!_stricmp(product,"LMCD") && _stricmp(entry->product,"nt")) // // Laying out sdk // || (!_stricmp(product,"SDK") && !_stricmp(entry->sdk,"x")); } int MyOpenFile(f,fileName,mode) FILE** f; char* fileName; char* mode; { if ((*f=fopen(fileName,mode))==NULL) { PRINT3("ERROR Couldn't open %s for %s\n",fileName,mode) return(1); } return(0); } void convertName(oldName,newName) char* oldName; char* newName; { unsigned i; unsigned period; strcpy(newName,oldName); for (period=(unsigned)(-1),i=0;i