Ejemplo n.º 1
0
void Fdirectory_namestring(CL_FORM *base)
{
	COPY(ARG(0), ARG(1));
	LOAD_SYMBOL(SYMBOL(Slisp, 232), ARG(2));	/* PATHNAME */
	rt_struct_typep(ARG(1));
	if(CL_TRUEP(ARG(1)))
	{
		COPY(ARG(0), ARG(1));
	}
	else
	{
		COPY(ARG(0), ARG(1));
		Fstringp(ARG(1));
		if(CL_TRUEP(ARG(1)))
		{
			COPY(ARG(0), ARG(1));
			LOAD_NIL(ARG(2));
			COPY(SYMVAL(Slisp, 231), ARG(3));	/* *DEFAULT-PATHNAME-DEFAULTS* */
			LOAD_SMALLFIXNUM(0, ARG(4));
			LOAD_NIL(ARG(5));
			LOAD_NIL(ARG(6));
			parse_namestring1(ARG(1));
			mv_count = 1;
		}
		else
		{
			COPY(ARG(0), ARG(1));
			LOAD_SYMBOL(SYMBOL(Slisp, 64), ARG(2));	/* STREAM */
			rt_struct_typep(ARG(1));
			if(CL_TRUEP(ARG(1)))
			{
				COPY(ARG(0), ARG(1));
				LOAD_NIL(ARG(2));
				file_name1(ARG(1));
				COPY(SYMVAL(Slisp, 231), ARG(2));	/* *DEFAULT-PATHNAME-DEFAULTS* */
				LOAD_SMALLFIXNUM(0, ARG(3));
				COPY(ARG(1), ARG(4));
				LOAD_NIL(ARG(5));
				COPY(ARG(2), ARG(6));
				COPY(ARG(3), ARG(7));
				LOAD_NIL(ARG(8));
				LOAD_NIL(ARG(9));
				parse_namestring1(ARG(4));
				mv_count = 1;
				COPY(ARG(4), ARG(1));
			}
			else
			{
				LOAD_SMSTR((CL_FORM *)&KClisp[94], ARG(1));	/* etypecase: the value ~a is not a legal value */
				COPY(ARG(0), ARG(2));
				Ferror(ARG(1), 2);
			}
		}
	}
	COPY(ARG(1), ARG(2));
	Ppathname_host(ARG(2));
	if(CL_TRUEP(ARG(2)))
	{
		COPY(ARG(1), ARG(0));
		Ppathname_directory(ARG(0));
		unparse_unix_directory_list(ARG(0));
	}
	else
	{
		LOAD_SMSTR((CL_FORM *)&KClisp[92], ARG(0));	/* Cannot determine the namestring for pathnames with no host:~%  ~S */
		Ferror(ARG(0), 2);
	}
}
Ejemplo n.º 2
0
void unparse_unix_enough(CL_FORM *base)
{
	LOAD_NIL(ARG(2));
	LOAD_NIL(ARG(3));
	ALLOC_CONS(ARG(4), ARG(2), ARG(3), ARG(2));
	COPY(ARG(0), ARG(3));
	Ppathname_directory(ARG(3));
	COPY(ARG(1), ARG(4));
	Ppathname_directory(ARG(4));
	COPY(ARG(4), ARG(5));
	Flength(ARG(5));
	COPY(ARG(5), ARG(6));
	LOAD_FIXNUM(ARG(7), 1, ARG(7));
	Fgt(ARG(6), 2);
	if(CL_TRUEP(ARG(6)))
	{
		COPY(ARG(3), ARG(6));
		Flength(ARG(6));
		COPY(ARG(5), ARG(7));
		Fge(ARG(6), 2);
		if(CL_TRUEP(ARG(6)))
		{
			COPY(ARG(3), ARG(6));
			LOAD_FIXNUM(ARG(7), 0, ARG(7));
			COPY(ARG(5), ARG(8));
			subseq1(ARG(6));
			COPY(ARG(4), ARG(7));
			compare_component(ARG(6));
		}
		else
		{
			goto ELSE1;
		}
	}
	else
	{
		goto ELSE1;
	}
	if(CL_TRUEP(ARG(6)))
	{
		LOAD_SYMBOL(SYMBOL(Slisp, 270), ARG(6));	/* RELATIVE */
		COPY(ARG(5), ARG(7));
		COPY(ARG(3), ARG(8));
		Fnthcdr(ARG(7));
		ALLOC_CONS(ARG(8), ARG(6), ARG(7), ARG(6));
	}
	else
	{
		ELSE1:;
		if(CL_CONSP(ARG(3)))
		{
			COPY(GET_CAR(ARG(3)), ARG(6));
		}
		else
		{
			if(CL_TRUEP(ARG(3)))
			{
				LOAD_SMSTR((CL_FORM *)&KClisp[264], ARG(6));	/* ~a is not a list */
				COPY(ARG(3), ARG(7));
				Ferror(ARG(6), 2);
			}
			else
			{
				COPY(ARG(3), ARG(6));
			}
		}
		if(CL_SYMBOLP(ARG(6)) && GET_SYMBOL(ARG(6)) == SYMBOL(Slisp, 267))	/* ABSOLUTE */
		{
			COPY(ARG(3), ARG(6));
		}
		else
		{
			LOAD_SMSTR((CL_FORM *)&KClisp[232], ARG(6));	/* ~S cannot be represented relative to ~S */
			COPY(ARG(0), ARG(7));
			COPY(ARG(1), ARG(8));
			Ferror(ARG(6), 3);
		}
	}
	COPY(ARG(6), ARG(7));
	unparse_unix_directory_list(ARG(7));
	COPY(ARG(2), ARG(8));
	add_q(ARG(7));
	COPY(ARG(0), ARG(3));
	Ppathname_version(ARG(3));
	if(CL_TRUEP(ARG(3)))
	{
		if(CL_SYMBOLP(ARG(3)) && GET_SYMBOL(ARG(3)) == SYMBOL(Slisp, 269))	/* NEWEST */
		{
			LOAD_NIL(ARG(4));
		}
		else
		{
			LOAD_SYMBOL(SYMBOL(Slisp, 48), ARG(4));	/* T */
		}
	}
	else
	{
		LOAD_NIL(ARG(4));
	}
	COPY(ARG(0), ARG(5));
	Ppathname_type(ARG(5));
	if(CL_TRUEP(ARG(4)))
	{
		COPY(ARG(4), ARG(6));
	}
	else
	{
		if(CL_TRUEP(ARG(5)))
		{
			if(CL_SYMBOLP(ARG(5)) && GET_SYMBOL(ARG(5)) == SYMBOL(Slisp, 266))	/* UNSPECIFIC */
			{
				LOAD_NIL(ARG(6));
			}
			else
			{
				LOAD_SYMBOL(SYMBOL(Slisp, 48), ARG(6));	/* T */
			}
		}
		else
		{
			LOAD_NIL(ARG(6));
		}
	}
	COPY(ARG(0), ARG(7));
	Ppathname_name(ARG(7));
	if(CL_TRUEP(ARG(6)))
	{
		COPY(ARG(6), ARG(8));
	}
	else
	{
		if(CL_TRUEP(ARG(7)))
		{
			COPY(ARG(7), ARG(8));
			COPY(ARG(1), ARG(9));
			Ppathname_name(ARG(9));
			compare_component(ARG(8));
			if(CL_TRUEP(ARG(8)))
			{
				LOAD_NIL(ARG(8));
			}
			else
			{
				LOAD_SYMBOL(SYMBOL(Slisp, 48), ARG(8));	/* T */
			}
		}
		else
		{
			LOAD_NIL(ARG(8));
		}
	}
	if(CL_TRUEP(ARG(8)))
	{
		if(CL_TRUEP(ARG(7)))
		{
		}
		else
		{
			LOAD_SMSTR((CL_FORM *)&KClisp[232], ARG(9));	/* ~S cannot be represented relative to ~S */
			COPY(ARG(0), ARG(10));
			COPY(ARG(1), ARG(11));
			Ferror(ARG(9), 3);
		}
		COPY(ARG(7), ARG(9));
		unparse_unix_piece(ARG(9));
		COPY(ARG(2), ARG(10));
		add_q(ARG(9));
	}
	if(CL_TRUEP(ARG(6)))
	{
		if(CL_TRUEP(ARG(5)))
		{
			LOAD_NIL(ARG(9));
		}
		else
		{
			LOAD_SYMBOL(SYMBOL(Slisp, 48), ARG(9));	/* T */
		}
		if(CL_TRUEP(ARG(9)))
		{
			goto THEN2;
		}
		else
		{
		}	/* UNSPECIFIC */
		if(CL_SYMBOLP(ARG(5)) && GET_SYMBOL(ARG(5)) == SYMBOL(Slisp, 266))
		{
			THEN2:;
			LOAD_SMSTR((CL_FORM *)&KClisp[232], ARG(9));	/* ~S cannot be represented relative to ~S */
			COPY(ARG(0), ARG(10));
			COPY(ARG(1), ARG(11));
			Ferror(ARG(9), 3);
		}
		LOAD_SMSTR((CL_FORM *)&Kunparse_unix_enough[0], ARG(9));	/* . */
		COPY(ARG(2), ARG(10));
		add_q(ARG(9));
		COPY(ARG(5), ARG(9));
		unparse_unix_piece(ARG(9));
		COPY(ARG(2), ARG(10));
		add_q(ARG(9));
	}
	if(CL_TRUEP(ARG(4)))
	{
		if(CL_SYMBOLP(ARG(3)) && GET_SYMBOL(ARG(3)) == SYMBOL(Slisp, 271))	/* WILD */
		{
			LOAD_SMSTR((CL_FORM *)&Kunparse_unix_enough[2], ARG(9));	/* .* */
			COPY(ARG(2), ARG(10));
			add_q(ARG(9));
		}
		else
		{
			if(CL_FIXNUMP(ARG(3)))
			{
				LOAD_NIL(ARG(9));
				LOAD_SMSTR((CL_FORM *)&Kunparse_unix_enough[4], ARG(10));	/* .~D */
				COPY(ARG(3), ARG(11));
				Fformat(ARG(9), 3);
				mv_count = 1;
				COPY(ARG(2), ARG(10));
				add_q(ARG(9));
			}
			else
			{
				LOAD_SMSTR((CL_FORM *)&KClisp[232], ARG(9));	/* ~S cannot be represented relative to ~S */
				COPY(ARG(0), ARG(10));
				COPY(ARG(1), ARG(11));
				Ferror(ARG(9), 3);
			}
		}
	}
	LOAD_GLOBFUN(&CFconcatenate, ARG(3));
	LOAD_SYMBOL(SYMBOL(Slisp, 40), ARG(4));	/* SIMPLE-STRING */
	COPY(GET_CAR(ARG(2)), ARG(5));
	Fapply(ARG(3), 3);
	COPY(ARG(3), ARG(0));
}