##########################################################################
# <_xZkqqHx_iKnGjAjE_xHqqkZx_>	PFArgsToTypes
#
# <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKnGjAjEjCiGiCmMiIpIjAjEjFlGiOjKjHpBiCpAjFkKiJpAjAkOjHjNiClFiCmEiBeBiMfOiCmMjHpBiCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
#
# <_xZkqqHx_iIpIjAjE_xHqqkZx_>	_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iIpIjAjEjFlGiOjKjHpBiCpAiOhHjCoIiBeCiJpMiNhDiCkKjDpMiCmBiCmEiCkCiCmEiCoAjHmHiCkCiBeC_xHqqkZx_
#
# <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jFmPiKlHiClDiCoKiClNiMfOjFlGiOjKjHpBiBeC_xHqqkZx_
#
# <_xZkqqHx_iPnKiNnH_xHqqkZx_>	_xZkqqHx_jHoBiBeG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_WString* strDirPath, WString* strFile,
#					  WString* strExtension,
#					  const wchar_t* tcpFileFull_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jFnEjCgM_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_WString*,WString*,WString*,const wchar_t*_xZkqqHx_iBhG_xHqqkZx_
#
# <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
##########################################################################
sub PFArgsToTypes
{
	local($l_args) = $_[0];

	local(@l_arglist) = split /,/, $l_args;	# _xZkqqHx_iIpIjAjEiCpA_xHqqkZx_,_xZkqqHx_iCmFjFkKiJpAiBeC_xHqqkZx_
	map { s/\[\]$// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmJ_xHqqkZx_[]_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/=.+// } @l_arglist;				# _xZkqqHx_iIpIjAjEiCmJ_xHqqkZx_"= XX"_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/^\s*// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmMiNmFiPiJiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_
	map { s/\s*$// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmMiNmFiMoDiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_
	map { s/(.*)\s+\w+$/$1/ } @l_arglist;	# _xZkqqHx_iIpIjAjEiCmMiMfOiCpAiOoGiCoIiPgPiClHiBeC_xHqqkZx_
	map { s/\s+/ /g } @l_arglist;			# _xZkqqHx_iDfOiDhFjDjJiCpAiLpDjEjCiCfAjFlGiOjKiCmJiBeC_xHqqkZx_
	map { s/\s+\*/\*/g } @l_arglist;		# *_xZkqqHx_iCmMjBePiCmMiLpDjEjCiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/\s+\&/\&/g } @l_arglist;		# &_xZkqqHx_iCmMjBePiCmMiLpDjEjCiCmNiNoNiPjMiBeC_xHqqkZx_

	local($l_return) = "";
	local($l_comma) = "";
	local($i);
	foreach $i (@l_arglist)
	{
		$l_return .= "${l_comma}$i";
		$l_comma = ",";
	}
	$l_return;
} # sub PFArgsToTypes.

##########################################################################
# <_xZkqqHx_iKnGjAjE_xHqqkZx_>	PFArgsToVars
#
# <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKnGjAjEjCiGiCmMiIpIjAjEjFlGiOjKjHpBiCpAjFkKiJpAjAkOjHjNiClFiCmEiBeBjFmPjAjEiCmMjHpBiCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
#
# <_xZkqqHx_iIpIjAjE_xHqqkZx_>	_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iIpIjAjEjFlGiOjKjHpBiCpAiOhHjCoIiBeCiJpMiNhDiCkKjDpMiCmBiCmEiCkCiCmEiCoAjHmHiCkCiBeC_xHqqkZx_
#
# <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAkOjHjNiClDiCoKiClNjFmPjAjEjFlGiOjKjHpBiBeC_xHqqkZx_
#
# <_xZkqqHx_iPnKiNnH_xHqqkZx_>	_xZkqqHx_jHoBiBeG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_WString* strDirPath, WString* strFile,
#					  WString* strExtension,
#					  const wchar_t* tcpFileFull_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jFnEjCgM_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_strDirPath,strFile,strExtension,tcpFileFull_xZkqqHx_iBhG_xHqqkZx_
#
# <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
##########################################################################
sub PFArgsToVars
{
	local($l_args) = $_[0];

	# _xZkqqHx_iIpIjAjEiCmMiDgGiDhEiDeIiDiLiDgHjCgMiCmJ_xHqqkZx_(,)_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiBeB_xHqqkZx_","_xZkqqHx_iCpAiOoGiCoIiPjMiCkNiBeC_xHqqkZx_
	# _xZkqqHx_iBgJjHoBiBeG_xHqqkZx_CSize a = CSize(0,0) _xZkqqHx_iBkI_xHqqkZx_ CSize a = CSize(00)_xZkqqHx_iBgK_xHqqkZx_
	do {
		$l_args0 = $l_args;
		$l_args =~ s/\(([^\)]+),([^\)]+)\)/\($1$2\)/g;
	} while ($l_args ne $l_args0);

	local(@l_arglist) = split /,/, $l_args;	# _xZkqqHx_iIpIjAjEiCpA_xHqqkZx_,_xZkqqHx_iCmFjFkKiJpAiBeC_xHqqkZx_
	map { s/\[\]$// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmJ_xHqqkZx_[]_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/=.+// } @l_arglist;				# _xZkqqHx_iIpIjAjEiCmJ_xHqqkZx_"= XX"_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/^\s*// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmMiNmFiPiJiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_
	map { s/\s*$// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmMiNmFiMoDiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_
	map { s/.*\s+(\w+)$/$1/ } @l_arglist;	# _xZkqqHx_jFmPjAjEiCpAiOoGiCoIiPgPiClHiBeC_xHqqkZx_

	local($l_return) = "";
	local($l_comma) = "";
	local($i);
	foreach $i (@l_arglist)
	{
		$l_return .= "${l_comma}$i";
		$l_comma = ",";
	}
	$l_return;
} # sub PFArgsToVars.

##########################################################################
# <_xZkqqHx_iKnGjAjE_xHqqkZx_>	PFArgsToStdArgs
#
# <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKnGjAjEjCiGiCmMiIpIjAjEjFlGiOjKjHpBiCpAjFkKiJpAjAkOjHjNiClFiCmEiBeBiIpIjAjEiCmMjHpBiCmJjFmPiKlHiClHiCoJiBeC_xHqqkZx_
#
# <_xZkqqHx_iIpIjAjE_xHqqkZx_>	_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iIpIjAjEjFlGiOjKjHpBiCpAiOhHjCoIiBeCiJpMiNhDiCkKjDpMiCmBiCmEiCkCiCmEiCoAjHmHiCkCiBeC_xHqqkZx_
#
# <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_jAkOjHjNiClDiCoKiClNjFmPjAjEjFlGiOjKjHpBiBeCiDgGiDhEiDeIiDiLiDgHjCgMiBgJ_xHqqkZx_= XX_xZkqqHx_iBgKiCkKiNoNiPjMiClDiCoKiCoJiBeC_xHqqkZx_
#
# <_xZkqqHx_iPnKiNnH_xHqqkZx_>	_xZkqqHx_jHoBiBeG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_WString* strDirPath, WString* strFile,
#					   WString* strExtension = L"ABC"_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jFnEjCgM_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_WString* strDirPath, WString* strFile,
#					   WString* strExtension_xZkqqHx_iBhG_xHqqkZx_
#
# <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
##########################################################################
sub PFArgsToStdArgs
{
	local($l_args) = $_[0];

	# _xZkqqHx_iIpIjAjEiCmMiDgGiDhEiDeIiDiLiDgHjCgMiCmJ_xHqqkZx_(,)_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiBeB_xHqqkZx_","_xZkqqHx_iCpAiOoGiCoIiPjMiCkNiBeC_xHqqkZx_
	# _xZkqqHx_iBgJjHoBiBeG_xHqqkZx_CSize a = CSize(0,0) _xZkqqHx_iBkI_xHqqkZx_ CSize a = CSize(00)_xZkqqHx_iBgK_xHqqkZx_
	do {
		$l_args0 = $l_args;
		$l_args =~ s/\(([^\)]+),([^\)]+)\)/\($1$2\)/g;
	} while ($l_args ne $l_args0);

	local(@l_arglist) = split /,/, $l_args;	# _xZkqqHx_iIpIjAjEiCpA_xHqqkZx_,_xZkqqHx_iCmFjFkKiJpAiBeC_xHqqkZx_
	map { s/=.+// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmJ_xHqqkZx_"= XX"_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/^\s*// } @l_arglist;		# _xZkqqHx_iIpIjAjEiCmMiNmFiPiJiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_
	map { s/\s*$// } @l_arglist;		# _xZkqqHx_iIpIjAjEiCmMiNmFiMoDiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_

	local($l_return) = "";
	local($l_comma) = "";
	local($i);
	foreach $i (@l_arglist)
	{
		$l_return .= "${l_comma}$i";
		$l_comma = ",";
	}
	$l_return;
} # sub PFArgsToStdArgs.

##########################################################################
# <_xZkqqHx_iKnGjAjE_xHqqkZx_>	PFMakeFuncStr
#
# <_xZkqqHx_iLeAjEfM_xHqqkZx_>	_xZkqqHx_iKnGjAjEjGlMiBeBiIpIjAjEiDiKiDfIiDgHiCkJiCoHiKnGjAjEiCmMiMmEiCnBiPgPiClFjFlGiOjKjHpBiCpAiNoMjAkMiClHiCoJiBeC_xHqqkZx_
#
# <_xZkqqHx_iIpIjAjE_xHqqkZx_>	_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_jGnPiCoIjCgMiCmMiMfOiCpAiOhHjCoIiBeC_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_2_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iKnGjAjEjGlMiCpAiOhHjCoIiBeC_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_3_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iIpIjAjEjFlGiOjKjHpBiCpAiOhHjCoIiBeCiJpMiNhDiCkKjDpMiCmBiCmEiCkCiCmEiCoAjHmHiCkCiBeC_xHqqkZx_
#
# <_xZkqqHx_jFnEjCgM_xHqqkZx_>	_xZkqqHx_iKnGjAjEiCmMiMmEiCnBiPgPiClFjFlGiOjKjHpBiBeC_xHqqkZx_
#
# <_xZkqqHx_iPnKiNnH_xHqqkZx_>	_xZkqqHx_jHoB_xHqqkZx_1_xZkqqHx_iBeG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_BOOL_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_2_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_Global::CallAbc_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_3_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_WString* strDirPath, WString* strFile,
#					   WString* strExtension = L"ABC"_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jFnEjCgM_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_return Global::CallAbc(strDirPath,strFile,strExtension)_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jHoB_xHqqkZx_2_xZkqqHx_iBeG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_1_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_int*_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_2_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_FuncXyz_xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jBoG_xHqqkZx_3_xZkqqHx_iIpIjAjE_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_DWORD dwA, DWORD dwB, ..._xZkqqHx_iBhG_xHqqkZx_
#			_xZkqqHx_jFnEjCgM_xHqqkZx_	:_xZkqqHx_iBhF_xHqqkZx_
#						va_list _argList;
#						va_start(_argList, dwB);
#						int* _retv = FuncXyzV(dwA,dwB,_argList);
#						va_end(_argList);
#						return _retv;
#					  _xZkqqHx_iBhG_xHqqkZx_
#
# <_xZkqqHx_jHjKjHpA_xHqqkZx_>	03.06.05 Fukushiro M. _xZkqqHx_iNoMjAkM_xHqqkZx_
##########################################################################
sub PFMakeFuncStr
{
	local($l_type) = $_[0];
	local($l_func) = $_[1];
	local($l_args) = $_[2];

	# _xZkqqHx_iIpIjAjEiCmMiDgGiDhEiDeIiDiLiDgHjCgMiCmJ_xHqqkZx_(,)_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiBeB_xHqqkZx_","_xZkqqHx_iCpAiOoGiCoIiPjMiCkNiBeC_xHqqkZx_
	# _xZkqqHx_iBgJjHoBiBeG_xHqqkZx_CSize a = CSize(0,0) _xZkqqHx_iBkI_xHqqkZx_ CSize a = CSize(00)_xZkqqHx_iBgK_xHqqkZx_
	do {
		$l_args0 = $l_args;
		$l_args =~ s/\(([^\)]+),([^\)]+)\)/\($1$2\)/g;
	} while ($l_args ne $l_args0);

	local(@l_arglist) = split /,/, $l_args;	# _xZkqqHx_iIpIjAjEiCpA_xHqqkZx_,_xZkqqHx_iCmFjFkKiJpAiBeC_xHqqkZx_
	map { s/\[\]$// } @l_arglist;		# _xZkqqHx_iIpIjAjEiCmJ_xHqqkZx_[]_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/=.+// } @l_arglist;			# _xZkqqHx_iIpIjAjEiCmJ_xHqqkZx_"= XX"_xZkqqHx_iCkKjFhEiCkCiCmEiCkCiCoJiPoKiNiHiCmNiNoNiPjMiBeC_xHqqkZx_
	map { s/^\s*// } @l_arglist;		# _xZkqqHx_iIpIjAjEiCmMiNmFiPiJiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_
	map { s/\s*$// } @l_arglist;		# _xZkqqHx_iIpIjAjEiCmMiNmFiMoDiCmMiLpDjEjCiBeFiJpMiNhDiCpAiNoNiPjMiBeC_xHqqkZx_
	map { s/.*\s+(\w+)$/$1/ } @l_arglist;	# _xZkqqHx_jFmPjAjEiCpAiOoGiCoIiPgPiClHiBeC_xHqqkZx_

	local($l_vars) = "";
	local($l_return) = "";
	local($l_comma) = "";
	local($l_lastVar) = "";
	local($l_isAmbig) = 0;
	local($i);
	WID:foreach $i (@l_arglist)
	{
		if ($i eq '...')
		{
			${l_isAmbig} = 1;
			$l_vars .= "${l_comma}_argList";
			last WID;
		}
		$l_vars .= "${l_comma}$i";
		$l_comma = ",";
		$l_lastVar = $i;
	}

	if (${l_type} eq 'void' and ${l_isAmbig} == 1)
	{

		$l_return .= << "EndOfText";
	va_list _argList;
	va_start(_argList, ${l_lastVar});
	${l_func}(${l_vars});
	va_end(_argList);
EndOfText

	} elsif (${l_type} ne 'void' and ${l_isAmbig} == 1)
	{

		$l_return .= << "EndOfText";
	va_list _argList;
	va_start(_argList, ${l_lastVar});
	${l_type} _ret = ${l_func}(${l_vars});
	va_end(_argList);
	return _ret;
EndOfText

	} elsif (${l_type} eq 'void' and ${l_isAmbig} == 0)
	{

		$l_return .= << "EndOfText";
	${l_func}(${l_vars});
EndOfText

	} else
	{

		$l_return .= << "EndOfText";
	return ${l_func}(${l_vars});
EndOfText

	}
	$l_return;
} # sub PFMakeFuncStr.

1;
