/*<Header>==============================================================
*
*	STRINGS OPERATION / "EIN_ST03.C"
*
*		[ EIN(tm) project : 文字列操作補助関数群 ]
*
*	COPYRIGHT  Nam & みんたっ♪  1994, All rights reserved.
*
*-----------------------------------------------------------------------
*	V1.0L01α	94.07.16/Nam	プロトタイプ(みんたっ♪さんの関数を利用)
*</Header>==============================================================*/
#include	<stdio.h>
#include 	<stdlib.h>
#include 	<string.h>
#include	<snd.h>
#include	<winb.h>
#include	<te.h>
#include	<fntb.h>
#include	<gui.h>

#define	EIN_FSTR
#include	"..\eintm.h"

#ifndef NOERR
#define	NOERR	(0)
#endif
#ifndef ERROR
#define	ERROR	(1)
#endif

extern char	*EIN_strrchr( char *, char );

/*<Func>================================================================
*	int		EIN_fnameNonDirectory( char *src, char *dst )
*
*	【概  要】	パス名からディレクトリ部分を除いたファイル名を返す。
*
*	【機  能】	パス名からディレクトリ部分を除いたファイル名を返します。
*
*	【入  力】*src		:
*
*	【出  力】*dst		:
*
*	【関数値】	==0			正常終了
*				!=0			異常終了
*
*	【注  意】	
*
*	【参  照】	EIN_strrchr
*
*-----------------------------------------------------------------------
*	V11L10	1994.07.16/Nam
*</Func>==============================================================*/
int		EIN_fnameNonDirectory( char *src, char *dst )
{
	char	*fnp;	/* ファイル名解析ポインタ */
	
	if ( src==NULL || dst==NULL ){
		return ERROR;
	}
	if ( ((fnp = EIN_strrchr(src, '\\')) != NULL)||	/* パス指定は有る? */
		 ((fnp = EIN_strrchr(src, ':' )) != NULL)){	/* ドライブ指定は? */
		fnp++;
	} else {
		fnp = src;
	}
	strcpy(dst, fnp);	/* ファイル名部をコピー */

	return NOERR;
}

