/* Copyright (c) 2002-2012 Croteam Ltd. All rights reserved. */ #include "StdH.h" #include "Dependency.h" // Depend - extract dependencies and create group file utility #define ACHR_OPTION argv[1] #define ACHR_APP_DIR argv[2] void PrintUsage() { printf( "\nUSAGE:\n" "Depend d \n" " make difference beetween two dependency files (result = file 1 - file 2)\n" "Depend i \n" " create dependencies for files listed in given list file\n" "Depend u \n" " remove updated files from dependency file\n" "Depend e \n" " export dependency file to ascii list file\n" "Depend t \n" " export strings for translation\n" "\n"); exit( EXIT_FAILURE); } void SubMain( int argc, char *argv[]); int main( int argc, char *argv[]) { CTSTREAM_BEGIN { SubMain(argc, argv); } CTSTREAM_END; return 0; } void SubMain( int argc, char *argv[]) { // there must be 4 or 6 parameters (first is depend.exe file name) if( (argc < 4) || (argc > 6) ) { PrintUsage(); } // initialize engine SE_InitEngine(""); // get application path from cmd line _fnmApplicationPath = CTString(ACHR_APP_DIR); // if not ending with backslash if (_fnmApplicationPath[strlen(_fnmApplicationPath)-1]!='\\') { _fnmApplicationPath += "\\"; } // get all filenames from command line CTFileName afnFiles[3]; INDEX ctFiles = argc-3; if (ctFiles>ARRAYCOUNT(afnFiles)) { PrintUsage(); } for (INDEX iFile=0; iFile