#include #include #include #include #include #include "general.h" #define false 0 #define true 1 FILE* logFile; char* product; void Header(argv) char* argv[]; { time_t t; PRINT1("\n=========== CHECKDIR =============\n") PRINT2("Input BOM: %s\n",argv[2]); PRINT2("Input Source %s\n",argv[3]); PRINT2("Input Share %s\n",argv[4]); time(&t); PRINT2("Time: %s",ctime(&t)) PRINT1("================================\n\n"); } void Usage() { printf("PURPOSE: Identifies which files are not being copied from the directories.\n"); printf("\n"); printf("PARAMETERS:\n"); printf("\n"); printf("[LogFile] - Path to append a log of actions and errors.\n"); printf("[InBom] - Path of BOM to be checked.\n"); printf("[Source] - Source ID.\n"); printf("[Share] - Share point for given Source.\n"); } int _CRTAPI1 PrioritySourcePathCompare(const void*,const void*); int Same(e1,e2) Entry* e1; Entry* e2; { return( (!_stricmp(e1->name,e2->name)) && (!_stricmp(e1->path,e2->path)) && (!_stricmp(e1->source,e2->source)) && (!_stricmp(e1->cdpath,e2->cdpath)) ); } int _CRTAPI1 main(argc,argv) int argc; char* argv[]; { FILE *inBom; Entry *e; int records,i,Dir_Index; char *buf; char *path; char *current_dir; BOOL FOUND; WIN32_FIND_DATA lpffd; HANDLE hdir; if (argc!=5) { Usage(); return(1); } if ((logFile=fopen(argv[1],"a"))==NULL) { printf("ERROR Couldn't open log file %s\n",argv[1]); return(1); } Header(argv); LoadFile(argv[2],&buf,&e,&records,"all"); qsort(e,records,sizeof(Entry),PrioritySourcePathCompare); i=0; while((isource,e2->source)) return(result); return (_stricmp(e1->path,e2->path)); /* BUG? */ }