#include <string.h>

void _splitpath(char*path, char *drive, char *dir, char*name, char *ext)
{
	char *v,*p, *x;
	v = strchr(path,':');
	p = path;
	x = drive;
	while (p <=v)
		*x++ = *p++;
	*x = 0;
	v = strrchr(path,'\\');
	x = dir;
	while (p <= v)
		*x++ = *p++;
	*x = 0;
	v = strrchr(path,'.');
	if (v == 0)
		v = path + strlen(path);
	x = name;
	while (p < v)
		*x++ = *p++;
	*x = 0;
	x = ext;
	while (*p)
		*x++=*p++;
	*x = 0;
}
void _makepath(char *path, char *drive, char *dir, char *name, char *ext)
{
	path[0] = 0;
	if (drive)
		strcat(path,drive);
	if (dir)
		strcat(path,dir);
	if (name)
		strcat(path,name);
	if (ext)
		strcat(path,ext);
}