reactos/boot/freeldr/tools/rrmdir.c
Hermès Bélusca-Maïto e1ef078741 Create this branch to work on loading of different Kernel-Debugger DLL providers, and see whether it is possible to move KDBG from ntoskrnl to a new DLL called, say, KDROSDBG.DLL.
The idea then would be to have the following behaviour (when specifying the following options in the kernel command line):

/DEBUGPORT=COMi --> load KDCOM.DLL and use COMi port (i == 1,2,3,4) if possible.
/DEBUGPORT=FOO  --> load KDFOO.DLL (useful for KDUSB.DLL, KD1394.DLL, KDBAZIS.DLL for VirtualKD, etc...)
/DEBUGPORT=ROSDBG:[COMi|SCREEN|FILE|GDB|...] --> load KDROSDBG.DLL which contains the ROS kernel debugger, and use COMi or SCREEN or... as output port.

svn path=/branches/kd++/; revision=58883
2013-04-28 13:26:45 +00:00

94 lines
1.7 KiB
C

/*
* COPYRIGHT: See COPYING in the top level directory
* PROGRAMMER: Rex Jolliff (rex@lvcablemodem.com)
* Casper S. Hornstrup (chorns@users.sourceforge.net)
* PURPOSE: Platform independant remove directory command
*/
#include <dirent.h>
#include <errno.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
void
convertPath (char * pathToConvert)
{
while (*pathToConvert != 0)
{
if (*pathToConvert == '\\')
{
*pathToConvert = '/';
}
pathToConvert++;
}
}
void
getDirectory (const char *filename, char * directorySpec)
{
int lengthOfDirectory;
if (strrchr (filename, '/') != 0)
{
lengthOfDirectory = strrchr (filename, '/') - filename;
strncpy (directorySpec, filename, lengthOfDirectory);
directorySpec [lengthOfDirectory] = '\0';
}
else
{
strcpy (directorySpec, ".");
}
}
void
getFilename (const char *filename, char * fileSpec)
{
if (strrchr (filename, '/') != 0)
{
strcpy (fileSpec, strrchr (filename, '/') + 1);
}
else
{
strcpy (fileSpec, filename);
}
}
int
main (int argc, char* argv[])
{
int justPrint = 0;
int idx;
int returnCode;
for (idx = 1; idx < argc; idx++)
{
convertPath (argv [idx]);
if (justPrint)
{
printf ("remove %s\n", argv [idx]);
}
else
{
returnCode = rmdir (argv [idx]);
if (returnCode != 0 && errno != ENOENT)
{
/* Continue even if there is errors */
#if 0
printf ("Rmdir of %s failed. Rmdir returned %d.\n",
argv [idx],
returnCode);
return returnCode;
#endif
}
}
}
return 0;
}