//	ＡＩＧライブラリ　基本関数：文字列関数
//		Copyright (C) 1989-1995,2000 by AIG-SOFT

#ifndef	__AIG_STRING__
#define	__AIG_STRING__	1

#include <stdarg.h>
#include <doslibm.h>
#include <time.h>
#include "deftype.h"

#ifdef	__cplusplus
// 95/11 : G++対応
extern	"C" {
#endif
#ifdef	__PROTO_TYPE
	int	ctrlstr(unchar *);
	int	ctrlstr2(unchar *,int);
	int	jctrlstr(unchar *);
	int	jcstring(unchar *,unchar *,unchar );
	int	rjcstring(unchar *,int ,unchar *,unchar );
	int	rjcstring2(unchar *,int ,unchar *);
	int	get_token_no(unchar *);
	int	get_token(unchar *,int,unchar *);
	int	get_token_no0(unchar *,unchar,unchar);
	int	get_token0(unchar *,int,unchar *,unchar,unchar);
	int	GetTokenNo(unchar *,unchar *);
	int	GetToken(unchar *,int,unchar *,unchar *);
	int	strcut(const unchar *,unchar **,int);
	int	maxlen(unchar **,int,int);
	int	maxlen2(unchar **,int,int);
	int	ainstr(unchar *,unchar *,int);
	int	chtab(const unchar *,unchar *,int);
	int	klen(unchar *str);
	int	klen2(unchar *str);
	int	fn_make(unchar *,unchar *,int);
	int	fn_ext(const unchar *,unchar *,const unchar *);
	int	fn_ext0(const unchar *,unchar *,const unchar *);
	int	fn_ext2(const unchar *,unchar *,const unchar *);
	int	sprintf2(char *,const char *,...);
	int	vsprintf2(char *,const char *,va_list);
	int	spcut(unchar *);
	int	spcut2(unchar *,unchar *);
	int	fnsplit3(const unchar *,unchar *,unchar *,unchar *
				,unchar *,unchar *,int,_FILBUF *,int);
	int	GetDateTime(unchar *);
	int	cutsp(unchar *,unchar *);
	int	cutspn(unchar *,unchar *,int );

	unchar	*string(unchar *,unchar,int);
	unchar	*kstring(int,const unchar *);
	unchar	*zstring(unchar *,unchar *,int);
	unchar	*strcat2(unchar *,unchar *,unchar *);
	unchar	*jstrupr(unchar *);
	unchar	*jstrlwr(unchar *);
	unchar	*jnstrcpy(unchar *,const unchar *,int);
	unchar	*znstrcpy(unchar *,const unchar *,int);
	unchar 	*jnstrcpy2(unchar *,const unchar *,int);
	unchar	*znstrcpy2(unchar *,const unchar *,int);
	unchar	*znstrcpy3(unchar *,const unchar *,int);
	unchar	*strchange(unchar *,int,int);
	unchar	*jstrchange(unchar *,unchar *,int,int);
	unchar	*zimdate(unchar *);
	unchar	*dir_name(unchar *,unchar *,unchar *);
	unchar	*dir_name2(unchar *,unchar *);
	unchar	*exename(const unchar *);
	unchar	*spccpy(unchar *,unchar *);
	unchar	*SplitDir(unchar *,unchar *);

	void	mids(const unchar *,int,int,unchar *);
	void	cut_c(unchar *,unchar);
	void	jcut_c(unchar *,unint);
	void	strcpy2(unchar *,unchar *);
	void	strcpy3(unchar *,unchar *);
	void	strcpy_not98(unchar *,unchar *,int );
	void	hidariyose(unchar *,const unchar *,int);
	void	shuffle(unchar **,int,int);
	void	strsfn2(const unchar *,unchar *,unchar *,unchar *,unchar *);
	void	strmfp2(unchar *,const unchar *,const unchar *,const unchar *);
	void	strmfp3(unchar *,const unchar *,const unchar *,const unchar *);
	void	strmfp20(unchar *,const unchar *,const unchar *,const unchar *);
	void	strmfp30(unchar *,const unchar *,const unchar *,const unchar *);
	void	fnget(unchar *,const unchar *,const unchar *);
	void	fnget2(unchar *,const unchar *,const unchar *);
	void	zenput(unint,unchar *);
	void	make_date(unchar *dt);
	void	make_date2(unchar *dt);
	void	make_time(unchar *tm);
	void	change_date2(time_t ,unchar *);
	void	exedir(unchar *,unchar *);
	void	DateFname(unchar *,unchar *,unchar *,unchar *);
	void	WildCut(unchar *,int );
#else
	int	ctrlstr();
	int	ctrlstr2();
	int	jctrlstr();
	int	jcstring();
	int	rjcstring();
	int	rjcstring2();
	int	get_token_no();
	int	get_token();
	int	get_token_no0();
	int	get_token0();
	int	GetToken();
	int	GetTokenNo();
	int	strcut();
	int	maxlen();
	int	maxlen2();
	int	ainstr();
	int	chtab();
	int	klen();
	int	klen2();
	int	fn_make();
	int	fn_ext();
	int	fn_ext0();
	int	fn_ext2();
	int	sprintf2();
	int	vsprintf2();
	int	spcut();
	int	spcut2();
	int	fnsplit3();
	int	GetDateTime();
	int	cutsp();
	int	cutspn();

	unchar	*string();
	unchar	*kstring();
	unchar	*zstring();
	unchar	*strcat2();
	unchar	*jstrupr();
	unchar	*jstrlwr();
	unchar	*jnstrcpy();
	unchar	*znstrcpy();
	unchar 	*jnstrcpy2();
	unchar	*znstrcpy2();
	unchar	*znstrcpy3();
	unchar	*strchange();
	unchar	*jstrchange();
	unchar	*zimdate();
	unchar	*dir_name();
	unchar	*dir_name2();
	unchar	*exename();
	unchar	*spccpy();
	unchar	*SplitDir();

	void	mids();
	void	cut_c();
	void	jcut_c();
	void	strcpy2();
	void	strcpy3();
	void	strcpy_not98();
	void	hidariyose();
	void	shuffle();
	void	strsfn2();
	void	strmfp2();
	void	strmfp3();
	void	strmfp20();
	void	strmfp30();
	void	fnget();
	void	fnget2();
	void	zenput();
	void	make_date();
	void	make_date2();
	void	make_time();
	void	change_date2();
	void	exedir();
	void	DateFname();
	void	WildCut();
#endif
#ifdef	__cplusplus
}
#endif

/* マクロ関数 */
#define	get_token(line,no,token)	(GetToken(line,no,token," \t"))
#define	get_token_no(line)		(GetTokenNo(line," \t"))
#define	zenput(c,buff)			{*buff=(c>>8); *(buff+1)=(unchar)c;}

#endif
