//                exc.cpp

// コマンドプロント用のプログラムで有る。インターネットには繋がりません。

//  三つ有るサブプログラムの一つでメインプログラム無しでは作動しません。

//  バグの検証、最適化はして有りません、悪しからず。

 

//  C++言語の為の学習用番号付きDIR表示のサンプルプログラムです。未完成でコンパイルしても正しく作動する保証は有りません。

//  このプログラムを使用して問題が発生しても責任は持てません、補償には応じ兼ねます、悪しからず。プログラムの学習専用です。

 

 

 

// これは、アプリケーション ウィザードを使って生成された、VC++ アプリケーション プロジェクトの

// メイン プロジェクト ファイルです。

 

#include "stdafx.h"

 

//#using <mscorlib.dll>

#include <tchar.h>

 

//using namespace System;

 

 

 

// exc.cpp : コンソール アプリケーション用のエントリ ポイントの定義

//

 

//#include     "stdafx.h"

#include     <stdio.h>

#include     <stdlib.h>

#include     <direct.h>

#include     <string.h>

#include     <ctype.h>

#include     <process.h>

#include     <locale.h>

#include     <conio.h>

#include     <sys\\stat.h>

#include     <time.h>

#include     <sys\\stat.h>

#include     <math.h>

#include     <io.h>

#include     <wchar.h>

#include     <direct.h>

#include     <errno.h>

 

 

 

 

 

 

#define      WXP        L"Microsoft Windows XP"

#define      W20        L"Microsoft Windows 20"

#define      WNT        L"Microsoft Windows NT"

#define      WMe        L"Microsoft Windows Me"

#define      WME        L"Microsoft Windows ME"

#define      W98        L"Microsoft Windows 98"

#define      W95        L"Microsoft Windows 95"

#define      IE         L"\\Program Files\\Internet Explorer\\iexplore.exe"

#define      MWORD      L"\\Program Files\\Microsoft Office\\Office\\WINWORD.EXE"

#define      EXCEL      L"\\Program Files\\Microsoft Office\\Office\\EXCEL.EXE"

#define      XPMWORD    L"\\Program Files\\Microsoft Office\\Office10\\WINWORD.EXE"

#define      XPEXCEL    L"\\Program Files\\Microsoft Office\\Office10\\EXCEL.EXE"

#define      OUTLOOK    L"\\Program Files\\Microsoft Office\\Office10\\OUTLOOK.EXE"

#define      OUTLOOKEX  L"\\Program Files\\Outlook Express\\msimn.exe"

#define      EX         L"explorer.exe"

#define      NOTE       L"system32\\NOTEPAD.exe"

#define      _UNICOD

#define      OASYS      L"\\Program Files\\OASYS2002\\PBIN\\oasys.exe"

 

 

 

extern int   excmain(int,wchar_t **,wchar_t **);

extern int   extcmdf(wchar_t *);

extern int       cdf(wchar_t *);

extern int      setf(wchar_t *);

extern int     helplistf(void);

extern int     envf(int);

wchar_t    prgdrive[10];

 

 

 

 

 

int         aaaa(void);

int        assocf(wchar_t   *);

wchar_t    *enn(wchar_t   *);

int         osf(void);

int    cmdfmain(int , wchar_t **,wchar_t **);

int        cmdf(wchar_t *);

int        inif(void);

 

int    nospacef(wchar_t *);

 

int      dirunc(wchar_t *,wchar_t *);

int      uncdir(wchar_t *,wchar_t *);

int     chdrive(wchar_t *);

int        dirf(wchar_t *);

int       xdirf(int,wchar_t *);

int       _dirf(wchar_t *);

int        excf(wchar_t *);

int     systemf(int,wchar_t *);

int  excsystemf(wchar_t *);

int modesystemf(wchar_t *);

int        test(void);

int         dor(wchar_t *);

int      exccmd(wchar_t *);

int         ief(wchar_t *);

int         exf(wchar_t *);

int      cdtest(wchar_t *);

int        pwdf(void);

int      kannji(wchar_t *);

int    fnamechf(wchar_t *);

int      pcname(wchar_t * ,wchar_t *);

int     norootf(wchar_t *);

int        keyf(void);

int       notef(wchar_t *);

int       wordf(wchar_t *);

int    outlookf(wchar_t *);

int      excelf(wchar_t *);

int       statf(wchar_t *);

int     attribf(int ,wchar_t *);

int     cdhistf(void);

int    cmdhistf(wchar_t *);

int      atimef(void);

int       cmdf3(wchar_t  *);

int       cmdf2(wchar_t  *);

int       cmdf4(wchar_t  *);

int       cmdf5(wchar_t  *);

int       cmdf6(wchar_t  *);

int      findf(wchar_t  *);

int   findsubf(wchar_t  *);

int    finddirf(int  ,wchar_t  *);

int      ctimef(void);

int     modedir(int ,wchar_t  *);

int       treef(int  ,wchar_t  *);

int    saigennf(int ,wchar_t *);

int       helpf(wchar_t *);

int    kennsaku(wchar_t *);

int       execf(int,wchar_t *);

int      spawnf(int,wchar_t *);

int       linef(wchar_t *);

int      linedf(wchar_t *);

int        urlf(void);

int      zenngo(wchar_t *,wchar_t *,wchar_t *);

int       pathdirf(wchar_t *,wchar_t *);

int       pathrootf(wchar_t *);

int       pathsubf(wchar_t *);

int      findfilef(wchar_t *);

int         ftypef(wchar_t *);

int         ftypef2(wchar_t *,wchar_t *);

int       errnof(void);

int    doserrnof(void);

int       errlistf(int);

int       envsetf(void);

int         batcmdf(void);

int          batrunf(wchar_t *);

int          holderf(wchar_t *);

int          endf(void);

int       sysexcf(void);

int        filenullf(wchar_t *);

int       avef(void);

 

 

int      zzzz(void);

 

wchar_t     osb[30];

wchar_t     *os=osb;

wchar_t     homeb[1024];

wchar_t     *home=homeb;

wchar_t     tempb[1024];

wchar_t     *temp=tempb;

wchar_t     noteb[1024];

wchar_t     *note=noteb;

wchar_t     wordb[1024];

wchar_t     *word=wordb;

wchar_t     wordsb[1024];

wchar_t     *words=wordsb;

wchar_t     outlookb[1024];

wchar_t     *outlook=outlookb;

wchar_t     outlook2b[1024];

wchar_t     *outlook2=outlook2b;

wchar_t     outlook2sb[1024];

wchar_t     *outlook2s=outlook2sb;

wchar_t     outlooksb[1024];

wchar_t     *outlooks=outlooksb;

wchar_t     excelb[1024];

wchar_t     *excel=excelb;

wchar_t     excelsb[1024];

wchar_t     *excels=excelsb;

wchar_t     oasysb[256];

wchar_t     *oasys=oasysb;

wchar_t     oasyssb[256];

wchar_t     *oasyss=oasyssb;

wchar_t     exb[1024];

wchar_t     *ex=exb;

wchar_t     ieb[1024];

wchar_t     *ie=ieb;

wchar_t     iesb[1024];

wchar_t     *ies=iesb;

wchar_t     pgb[1024];

wchar_t     *pg=pgb;

wchar_t     excpathb[1024];

wchar_t     excpath2b[1024];

wchar_t     excpath3b[1024];

wchar_t     excpath4b[1024];

wchar_t     excpath5b[1024];

wchar_t     excpath6b[1024];

wchar_t     excpath7b[1024];

wchar_t     excpath8b[1024];

wchar_t     excpath9b[1024];

wchar_t     excpath1b[1024];

wchar_t     *excpath=excpathb;

wchar_t     *excpath2=excpath2b;

wchar_t     *excpath3=excpath3b;

wchar_t     *excpath4=excpath4b;

wchar_t     *excpath5=excpath5b;

wchar_t     *excpath6=excpath6b;

wchar_t     *excpath7=excpath7b;

wchar_t     *excpath8=excpath8b;

wchar_t     *excpath9=excpath9b;

wchar_t     *excpath1=excpath1b;

wchar_t     pushdb[1024];

wchar_t     cdhist[50][1024];

wchar_t    cmdhist[50][1024];

wchar_t    xcopysb[2][1024];

wchar_t         usrpcb[30];

wchar_t         dirb[5000][1024];

wchar_t        cdirb[5000];

wchar_t      tmcdirb[5000];

wchar_t         uncb[5000];

wchar_t        guncb[5000];

wchar_t         prgdir[1024];

wchar_t     trdirb[5000][245];

wchar_t     pathb[300][1024];  

wchar_t     *path=excpathb;

wchar_t     temb[1024];

wchar_t     *tem=temb;

wchar_t     urlb[300][256];

wchar_t     urlname[300][50];

wchar_t     urlhttp[300][260];

wchar_t     path0b[1024];

wchar_t     *path0bp=path0b;

 

wchar_t     extenvb[100][1024];

wchar_t    *extenvp[100];

wchar_t    arg[20][5000];

wchar_t    *argp[20];

wchar_t     bkcdirb[5000];

 

 

wchar_t      systemrootb[1024];

wchar_t     *systemroot=systemrootb;

wchar_t      systemdriveb[1024];

wchar_t     *systemdrive=systemdriveb;

wchar_t      homepathb[256];   

wchar_t     *homepath=homepathb;       

wchar_t      homedriveb[10];

wchar_t     *homedrive=homedriveb;

wchar_t      userdomainb[30];

wchar_t     *userdomain=userdomainb;

wchar_t      usernameb[30];

wchar_t     *username=usernameb;

wchar_t      logonserverb[30];

wchar_t     *logonserver=logonserverb;

wchar_t      userprofileb[256];

wchar_t     *userprofile=userprofileb;

wchar_t      programfilesb[256];

wchar_t     *programfiles=programfilesb;

wchar_t      mydocumentsb[256];

wchar_t     *mydocumentos=mydocumentsb;

wchar_t      favoritesb[256];

wchar_t     *favorites=favoritesb;

 

int        debug=1;      //  DEBUG 1 / NO DEBUG 0

 

int          osno=0;

int        dirtop=0;

int       filetop=0;

int         inino=0;

int      _unicode=0;

int        _cdirf=0;

int       _usrpcf=0;

int      _kannjif=0;

int        cdrive=0;

int       _fnamef=0;

int     _cmdmodef=0;

int      cdhistno=0;

int     cmdhistno=0;

int     _dirfilef=0;

int     _treef_endf=0;

int     _xcopyf[3];

int      _lineno;

int     _cmdendf=0;

int      _findsubno=1;

int      _exitf=0;

 

 

 

 

 

//int   tcps(char *,char *,char *);

//int   tcpc(char *,char *,char *);

//int   udps(char *,char *,char *);

//int   udpc(char *,char *,char *);

 

//int   tcpsx(char *,char *,char *);

//int   tcpcx(char *,char *,char *);

//int   udpsx(char *,char *,char *);

//int   udpcx(char *,char *,char *);

 

//int  remsystem(char  *);

//int   tcpcmdf(char *);

//int    nodot(char  *);

//int    oyadirf(char *);

//int    prgexit(int);

//int    prgclose(int);

//int     buf0(char *,int);

//int     dots(char  *);

//int    tcpmain(void);

 

 

 

 

char      cdir[256];

char    remdir[256];

char    prgname[256];

char    uncdirb[256];

 

 

wchar_t    *env[]={

                  L"envhelp=help",

          L"envset=set",

                  L"",

                  NULL

          };

 

wchar_t   pathdirb[50][256];

 

 

 

 

void     calprn(char *,short);               ///cale

int      dotwll(short);

void      calset(short,short,char *,short);

void     cal12(char  *,short);

void     cal(char  *,short,short);

void     calef(void);

char   syuu[]={" Su Mo Tu We Th Fr Sa"};

char   *tukimei[]={"","January","February","March","April","May","June",

           "July","August","September","October","November","December","err"};

 

int       calcf(wchar_t *);                     ///  calc

long     double     mathf(char  *);

long     double     nextf(char  *);

long double  r[40];

 

 

 

 

 

int       aaaa(void)

{

 

        wprintf(L"aaaa() ");

                return(1);

}

 

extern int excmain(int argc, wchar_t **argv,wchar_t **envp)

{

       

       

        cdrive= _getdrive(); _wgetdcwd(cdrive,prgdir,1000);

       

        wprintf(L"prgdir=%s\n",prgdir);

        if(prgdir[1]==L':')

        {

        prgdrive[0]=prgdir[0];prgdrive[1]=L':';prgdrive[2]=L'\0';

        }

        if(cmdfmain(argc,argv,envp)==1)  return(1);

        return 0;

}

 

int   osf(void)

{

         wchar_t    tm[256];

         wchar_t    bf[2][256];

         int     i;

     FILE    *kakikomi,*yomidasi;

    

     for(i=0;i<256;++i) bf[0][i]=L'\0';

 

         

         swprintf(tm,L"ver > %s\\excdir\\ver.txt",temp);_wsystem(tm);

 

     swprintf(tm,L"%s\\excdir\\null.txt",temp);

     if((kakikomi=_wfopen(tm,L"w"))==NULL)

         {wprintf(L"Err! osf() _wfopen() ----->> Err file %s!\n",tm);}

         else

         {

                 bf[0][0]=L' ';bf[0][1]=L' ';bf[0][2]=L'\0';

                 if(fputws(bf[0],kakikomi)==NULL)

                                 ;

             else

                                 fclose(kakikomi);

                 

         }

    

         

         

         

         swprintf(tm,L"%s\\excdir\\ver.txt",temp);

         if((yomidasi=_wfopen(tm,L"r"))==NULL)

         {wprintf(L"Err! osf() _wfopen() ----->> No file %s!\n",tm);goto ESTA;}

         else

         {

                 for(i=0;i<2;++i)

                 {

                         if(fgetws(bf[i],256,yomidasi)==NULL)

                                 break;

                         else

                                 wprintf(L"%s",bf[i]);

                 }

         }

     fclose(yomidasi);

     

         wcscpy(tm,&bf[1][0]);

         for(i=0;i<256;++i)

         {

         if(tm[i]==L'[') {osb[i]=L'\0';break;}

                 else osb[i]=tm[i];

                 if(tm[i]<L' ')  {osb[i]=L'\0';break;}

         }

              if(wcsncmp(osb,WXP,20)==0)     {osno=1;dirtop=21;filetop=36;}

     else if(wcsncmp(osb,W20,20)==0)     {osno=2;dirtop=24;filetop=39;}

         else if(wcsncmp(osb,WNT,20)==0)     {osno=3;dirtop=21;filetop=36;}

         else if(wcsncmp(osb,WMe,20)==0)     {osno=4;dirtop=21;filetop=36;}

     else if(wcsncmp(osb,WME,20)==0)     {osno=4;dirtop=21;filetop=36;}

     else if(wcsncmp(osb,W98,20)==0)     {osno=5;dirtop=21;filetop=36;}

     else if(wcsncmp(osb,W95,20)==0)     {osno=6;dirtop=21;filetop=36;}

     else                                {osno=1;dirtop=21;filetop=36;}

 

 

 

         wprintf(L"os=%s  osno=%d dirtop=%d filetop=%d\n",os,osno,dirtop,filetop);

 

 

     return(0);

 

ESTA:     osno=1;dirtop=21;filetop=36; 

         return(0);

}

 

int  inif(void)

{

        wchar_t    tm[1024];

   

 

 

 

 

          osno=0;

        dirtop=0;

       filetop=0;

      _unicode=0;

        _cdirf=0;

       _usrpcf=0;

      _kannjif=0;

        cdrive=0;

       _fnamef=0;

     _cmdmodef=0;

   _treef_endf=0;

 

 

    setlocale(LC_ALL,"Japanese");

        logonserver=_wgetenv(L"LOGONSERVER");_wcslwr(logonserver);

    if((temp=_wgetenv(L"TEMP"))==NULL)

                if((temp=_wgetenv(L"TMP"))==NULL)

                        swprintf(temp,L"%s\\temp",homepath);

 

       

        if((systemroot=_wgetenv(L"SystemRoot"))==NULL)

                systemroot=_wgetenv(L"windir");

   

        wcscpy(cdhist[40],systemroot);

    pg=_wgetenv(L"ProgramFiles");

        if((systemdrive=_wgetenv(L"SystemDrive"))==NULL)

                if((systemdrive=_wgetenv(L"HOMEDRIVE"))==NULL)

                        wcscpy(systemdrive,L"C:");

    if((homedrive=_wgetenv(L"HOMEDRIVE"))==NULL)

                        wcscpy(homedrive,L"C:");

    if((homepath=_wgetenv(L"HOMEPATH"))==NULL)

                        wcscpy(homepath,L"C:\\");

      

 

        userdomain=_wgetenv(L"USERDOMAIN");

        username=_wgetenv(L"USERNAME");

        userprofile=_wgetenv(L"USERPROFILE");

        logonserver=_wgetenv(L"LOGONSERVER");

    if((programfiles=_wgetenv(L"ProgramFiles"))==NULL)

                swprintf(programfilesb,L"%s\\Program Files",systemdrive);

 

    swprintf(mydocumentsb,L"%s\\My Documents",userprofile);

        //swprintf(temp,L"%s\\temp",prgdrive);  // debg 

   

        wcscpy(cdhist[41],temp);

    wcscpy(cdhist[42],pg);

    swprintf(cdhist[43],L"%s\\Documents and Settings",systemdrive);

 

 

        wcscpy(cdhist[44],home);

        wcscpy(cdhist[45],systemroot);

        swprintf(cdhist[46],L"%s\\system32",systemroot);

 

 

        path=_wgetenv(L"PATH");

    path0bp=_wgetenv(L"PATH");

 

    if((excpath=_wgetenv(L"excpath"))==NULL)

        {

                swprintf(excpathb,L"excpath=\\;%s;%s\\system32;%s;%s\\excdir;%s\\excdir\\batcmd;c:\\;%s\\;",systemroot,systemroot,temp,temp,temp,systemdrive);

                _wputenv(excpathb);

        }

 

    if((excpath2=_wgetenv(L"excpath2"))==NULL)

        {

                swprintf(excpath2b,L"excpath2=%s;%s;%s\\My Music;%s\\My Pictures;%s\\My Videos",userprofile,mydocumentsb,mydocumentsb,mydocumentsb,mydocumentsb);

                _wputenv(excpath2b);

        }

 

        if((excpath3=_wgetenv(L"excpath3"))==NULL)

        {

                swprintf(excpath3b,L"excpath3=c:\\;d:\\;e:\\;f:\\;%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath3b);

        }

    if((excpath1=_wgetenv(L"excpath1"))==NULL)

        {

                swprintf(excpath1b,L"excpath1=%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath1b);

        }

    if((excpath4=_wgetenv(L"excpath4"))==NULL)

        {

                swprintf(excpath4b,L"excpath4=%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath4b);

        }

    if((excpath5=_wgetenv(L"excpath5"))==NULL)

        {

                swprintf(excpath5b,L"excpath5=%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath5b);

        }

    if((excpath6=_wgetenv(L"excpath6"))==NULL)

        {

                swprintf(excpath6b,L"excpath6=%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath6b);

        }

    if((excpath7=_wgetenv(L"excpath7"))==NULL)

        {

                swprintf(excpath7b,L"excpath7=%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath7b);

        }

    if((excpath8=_wgetenv(L"excpath8"))==NULL)

        {

                swprintf(excpath8b,L"excpath8=%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath8b);

        }

    if((excpath9=_wgetenv(L"excpath9"))==NULL)

        {

                swprintf(excpath9b,L"excpath9=%s\\r\\u\\jpg;%s;%s\\system32;%s\\temp;%s\\b;%s\\temp\\excdir;c:\\;%s\\;",systemdrive,systemroot,systemroot,systemdrive,systemdrive,systemdrive,systemdrive);

                _wputenv(excpath9b);

        }

 

 

 

 

        _unicode=1;     wprintf(L"_UNICODE");

 

        _wchdir(systemroot);

    cdrive=_getdrive();

 

    if(_wgetdcwd(cdrive,cdirb,_MAX_DIR)==NULL) {wprintf(L"Err! init() _wgetcwd() cdir==NULL");}

       

        if((cdirb[0]==L'\\') && (cdirb[1]==L'\\') && (cdirb[2]>L' '))

             {wcscpy(uncb,cdirb);uncdir(uncb,cdirb);}

        else   dirunc(cdirb,uncb);

        pcname(cdirb,usrpcb);

    if(_usrpcf==1) wcscpy(guncb,uncb);

 

        if(inino==0)

        {

                wcscpy(pushdb,cdirb);wcscpy(cdhist[cdhistno++],cdirb);

                swprintf(note, L"%s\\%s",systemroot,NOTE);

        swprintf(ex  , L"%s\\%s",systemroot,EX);

        swprintf(word, L"%s%s",systemdrive,XPMWORD);

        swprintf(words, L"\"%s%s\"",systemdrive,XPMWORD);

        swprintf(excel,L"%s%s",systemdrive,XPEXCEL);

                swprintf(excels,L"\"%s%s\"",systemdrive,XPEXCEL);

        swprintf(oasys,L"%s%s",systemdrive,OASYS);

                swprintf(oasyss,L"\"%s%s\"",systemdrive,OASYS);

                swprintf(outlook,L"%s%s",systemdrive,OUTLOOK);

        swprintf(outlook2,L"%s%s",systemdrive,OUTLOOKEX);

        swprintf(outlooks,L"\"%s\"",outlook);

                swprintf(outlook2s,L"\"%s\"",outlook2);

                swprintf(ie,   L"%s%s",systemdrive,IE);  /////////////////////////////////////////

        swprintf(ies,   L"\"%s\"",ie);

 

 

 

 

 

 

    //    _wmkdir(temp);         

                swprintf(tm,L"%s\\excdir",temp);

            _wmkdir(tm);

                if(_doserrno==2) {wprintf(L"Err! osf() _wmkdir() ----->> No path %s!\n",tm);}

       

       swprintf(tm,L"%s\\excdir\\batcmd",temp);

            _wmkdir(tm);

                if(_doserrno==2) {wprintf(L"Err! osf() _wmkdir() ----->> No path %s!\n",tm);}

          

        swprintf(tm,L"%s\\excdir\\sysexc",temp);

            _wmkdir(tm);

                if(_doserrno==2) {wprintf(L"Err! osf() _wmkdir() ----->> No path %s!\n",tm);}

       

   //           swprintf(tm,L"%s\\excdir\\null.txt",temp);

   //     if((kakikomi=_wfopen(tm,L"w"))==NULL)

   //         wprintf(L"Err! inif() _wfopen() No file! %s \n",tm);

//          else fputws(nullc,kakikomi);

//          fclose(kakikomi);

 

 

 

        

        }

        else

        {wcscpy(cdirb,home);cdf(systemroot);

        }

    ++inino;if(inino>30000) inino=9;

   

       

    osf();

 

        envf(1);

 

        batcmdf();

 

        sysexcf();

 

 

        return(0);

 

 

}

 

int     sysexcf(void)

{

     wchar_t   tm[1024];

 

         swprintf(tm,L"set  > %s\\excdir\\sysexc\\setexc.exc",temp);

         _wsystem(tm);

 

     swprintf(tm,L"help > %s\\excdir\\sysexc\\helpexc.exc",temp);

         _wsystem(tm);

 

      swprintf(tm,L"assoc  > %s\\excdir\\sysexc\\assocexc.exc",temp);

         _wsystem(tm);

 

          swprintf(tm,L"ftype  > %s\\excdir\\sysexc\\ftypeexc.exc",temp);

         _wsystem(tm);

 

     return(0);

}

 

int    batrunf(wchar_t  *cmdb)

{

    wchar_t  tm[1024];

  //  wchar_t  tm2[1024];

//      wchar_t  tm3[1024];

 

 

    if(wcscmp(cmdb,L"$dir")==0)

        {

          swprintf(tm,L"dir  %s\\excdir\\batcmd",temp);

                  _wsystem(tm); return(0);

        }

    if(wcscmp(cmdb,L"$DIR")==0)

        {

          swprintf(tm,L"dir  %s\\excdir\\batcmd",temp);

                  _wsystem(tm); return(0);

        }

   

        if(wcsncmp(cmdb,L"$type ",6)==0)

        {

          swprintf(tm,L"type  %s\\excdir\\batcmd\\%s",temp,&cmdb[6]);

                  _wsystem(tm); return(0);

        }

    if(wcsncmp(cmdb,L"$TYPE ",6)==0)

        {

          swprintf(tm,L"type  %s\\excdir\\batcmd\\%s",temp,&cmdb[6]);

                  _wsystem(tm); return(0);

        }

 

       

        swprintf(tm,L"%s\\excdir\\batcmd\\%s",temp,cmdb);

        _wsystem(tm);

 

        return(0);

}

 

int    holderf(wchar_t *cmdb)

{

     wchar_t   tm[1024];

       wchar_t   *tmp=tm;

 

 

       cdrive= _getdrive(); _wgetdcwd(cdrive,cdirb,1000);

           if(wcscmp(cmdb,L"&pwd")==0 || wcscmp(cmdb,L"&PWD")==0)  

           {

                   swprintf(tm,L"%s",tm);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&cwd")==0 || wcscmp(cmdb,L"&CWD")==0)  

           {

                   swprintf(tm,L"%s",tm);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&home")==0 || wcscmp(cmdb,L"&HOME")==0)  

           {

                   swprintf(tm,L"%s\\excdir",temp);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&batcmd")==0 || wcscmp(cmdb,L"&BATCMD")==0)  

           {

                   swprintf(tm,L"%s\\excdir\\batcmd",temp);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&temp")==0 || wcscmp(cmdb,L"&TEMP")==0)  

           {

                   swprintf(tm,L"%s",temp);

           dirf(tm); return(0);

           }

           else if(wcscmp(cmdb,L"&excdir")==0 || wcscmp(cmdb,L"&EXCDIR")==0)  

           {

                   swprintf(tm,L"%s\\excdir",temp);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&systemroot")==0 || wcscmp(cmdb,L"&SYSTEMROOT")==0)  

           {

                   swprintf(tm,L"%s",systemroot);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&system32")==0 || wcscmp(cmdb,L"&SYSTEM32")==0)  

           {

                   swprintf(tm,L"%s\\system32",systemroot);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&exc")==0 || wcscmp(cmdb,L"&EXC")==0)  

           {

                   swprintf(tm,L"%s",prgdir);

           dirf(tm); return(0);

           }  

       else if(wcscmp(cmdb,L"&usr")==0 || wcscmp(cmdb,L"&USR")==0)  

           {

                   swprintf(tm,L"%s",userprofile);

           dirf(tm); return(0);

           }

           else if(wcscmp(cmdb,L"&user")==0 || wcscmp(cmdb,L"&USER")==0)  

           {

                   swprintf(tm,L"%s",userprofile);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&myd")==0 || wcscmp(cmdb,L"&MYD")==0)  

           {

                   swprintf(tm,L"%s\\My Documents",userprofile);

           dirf(tm); return(0);

           }

           else if(wcscmp(cmdb,L"&music")==0 || wcscmp(cmdb,L"&MUSIC")==0)  

           {

                   swprintf(tm,L"%s\\My Documents\\My Music",userprofile);

           dirf(tm); return(0);

           }

                 else if(wcscmp(cmdb,L"&pictures")==0 || wcscmp(cmdb,L"&PICTURES")==0)  

           {

                   swprintf(tm,L"%s\\My Documents\\My Pictures",userprofile);

           dirf(tm); return(0);

           }

            else if(wcscmp(cmdb,L"&videos")==0 || wcscmp(cmdb,L"&VIDEOS")==0)  

           {

                   swprintf(tm,L"%s\\My Documents\\My Videos",userprofile);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&fav")==0 || wcscmp(cmdb,L"&FAB")==0)  

           {

                   swprintf(tm,L"%s\\Favorites",userprofile);

           dirf(tm); return(0);

           }

           else if(wcscmp(cmdb,L"&pgf")==0 || wcscmp(cmdb,L"&PGF")==0)  

           {

                   swprintf(tm,L"%s",programfiles);

           dirf(tm); return(0);

           }

       else if(wcscmp(cmdb,L"&dtop")==0 || wcscmp(cmdb,L"&DTOP")==0)  

           {

                   swprintf(tm,L"%s\\デスクトップ",userprofile);

           xdirf(0,tm); return(0);

           }

       else if(wcscmp(cmdb,L"&smenu")==0 || wcscmp(cmdb,L"&SMENU")==0)  

           {

                   swprintf(tm,L"%s\\スタート メニュー",userprofile);

           xdirf(0,tm); return(0);

           }

       else if(wcscmp(cmdb,L"&sprg")==0 || wcscmp(cmdb,L"&SPRG")==0)  

           {

                   swprintf(tm,L"%s\\スタート メニュー\\プログラム",userprofile);

                   xdirf(0,tm); return(0);

           }

           else if(wcscmp(cmdb,L"&akusesari")==0 || wcscmp(cmdb,L"&AKUSESARI")==0)  

           {

                   swprintf(tm,L"%s\\スタート メニュー\\プログラム\\アクセサリ",userprofile);

                   xdirf(0,tm); return(0);}

           else if(wcscmp(cmdb,L"&startup")==0 || wcscmp(cmdb,L"&STARTUP")==0)  

           {

                   swprintf(tm,L"%s\\スタート メニュー\\プログラム\\スタートアップ",userprofile);

           xdirf(0,tm); return(0);

           }

 

        return(0);

}

 

int    batcmdf(void)

{

    

     

      assocf(L".htm");

          assocf(L".txt");

          assocf(L".jpg");

          assocf(L".oas");

      assocf(L".xls");

          assocf(L".doc");

          assocf(L".msg");

          assocf(L".nws");

//        assocf(L".cpp");

      assocf(L".eml");

      assocf(L".gif");

          assocf(L".wmv");

          assocf(L".wma");

      assocf(L".url");

      assocf(L".wsf");

          assocf(L".wsh");

      assocf(L".vbs");

 

      return(0);

}

 

int   assocf(wchar_t  *cmdb)

{

     wchar_t temb[1024];

     wchar_t temb2[1024];

     int    i;

 

         FILE    *yomikomi;

 

 

         if(cmdb[0]!=L'.') return(0);

 

         swprintf(temb,L"assoc %s > %s\\excdir\\assoctxt.txt",cmdb,temp);

     _wsystem(temb);

         swprintf(temb,L"%s\\excdir\\assoctxt.txt",temp);

     if((yomikomi=_wfopen(temb,L"r"))==NULL)

         {wprintf(L"Err! acossf() _wfopen() assoctxt.txt No file!  \n");return(0);}

         else {fgetws(temb,1000,yomikomi); fclose(yomikomi);}

      

          for(i=0;i<1000;i++)

          {

                  if(temb[i]<L' ') {temb[i]=L'\0';break;}

                  if(temb[i]==L'=')

                  {

                          wcscpy(temb2,&temb[i+1]);break;

                  }

          }

          if(wcscmp(temb2,L"")==0) return(0);

          wprintf(L"%s=%s\n",cmdb,temb2);

 

        if((temb2[0]>'0') && (temb2[1]>'0'))

        ftypef2(cmdb,temb2);

       

 

        return(0);

}

 

int   ftypef2(wchar_t *cmdb,wchar_t *ftype)

{

     wchar_t temb[1024];

     wchar_t temb2[1024];

         wchar_t temb3[1024];

 

 

     int    i;

 

         FILE    *yomikomi,*kakikomi;

 

 

 

 

 

          if(cmdb[0]!=L'.') return(0);

 

      if((ftype[0]<'0') && (ftype[1]<'0')) return(0);

         enn(ftype);

 

 

         swprintf(temb,L"ftype %s > %s\\excdir\\ftype2.txt",ftype,temp);

     _wsystem(temb);

         swprintf(temb,L"%s\\excdir\\ftype2.txt",temp);

     if((yomikomi=_wfopen(temb,L"r"))==NULL)

         { wprintf(L"Err! ftypef2() _wfopen() %s No file!  \n",temb);return(0);}

           else

           {

                   fgetws(temb,1000,yomikomi);

               fclose(yomikomi);

           }

 

          for(i=0;i<1000;i++)

          {

                  if(temb[i]<L' ') {temb[i]=L'\0';temb2[i]=L'\0';break;}

                  if(temb[i]==L'=')

                  {

                          wcscpy(temb2,&temb[i+1]);break;

                  }

          }

          wprintf(L"%s=%s\n",ftype,temb2);

 

          if((temb2[0]<L'0') && (temb2[0]<L'0')) return(0);

      swprintf(temb3,L"%s\\excdir\\batcmd\\$%s.cmd",temp,&cmdb[1]);

      if((kakikomi=_wfopen(temb3,L"w"))==NULL)

          {wprintf(L"Err! ftypef2() _wfopen() %s Err file!  \n",temb3);return(0);}

           else

           {

                   fputws(temb2,kakikomi);

               fclose(kakikomi);

           }

 

 

 

        return(0);

}

 

 

int    saigennf(int   cmdf,wchar_t *cmdb)

{

       wchar_t   tm0[5000],tm1[5000],tm2[5000],tm3[5000];

 

           FILE     *kakikomi,*yomikomi;

      

           swprintf(tm0,L"%s\\excdir\\batcmd\\$saigenn.cmd",temp);

           swprintf(tm1,L"type %s",tm0);

       swprintf(tm2,L"%s\\excdir\\$saigenn.exc",temp);

       swprintf(tm3,L"type %s",tm0);

 

 

 

       if(cmdf==0)

           {

       if((kakikomi=_wfopen(tm0,L"w"))==NULL)

            wprintf(L"Err! saigenn() _wfopen() No file! %s \n",tm0);

           else fputws(cmdb,kakikomi);

           fclose(kakikomi);

           _wsystem(cmdb);

           }

           if(cmdf==1)

           {

       if((kakikomi=_wfopen(tm0,L"w"))==NULL)

            wprintf(L"Err! saigenn() _wfopen() No file! %s \n",tm2);

           else fputws(&cmdb[4],kakikomi);

           fclose(kakikomi);

           }  

           else if(cmdf==2)

           {

                   if((yomikomi=_wfopen(tm0,L"r"))==NULL)

            wprintf(L"Err! saigenn() _wfopen() No file! %s \n",tm0);

           else fgetws(cmdb,5000,yomikomi);

           fclose(yomikomi);

            _wsystem(tm0);

           }

       else if(cmdf==3)

           {

                   if((yomikomi=_wfopen(tm0,L"r"))==NULL)

            wprintf(L"Err! saigenn() _wfopen() No file! %s \n",tm2);

           else fgetws(cmdb,5000,yomikomi);

           fclose(yomikomi);

         

           }

       else if(cmdf==4)

           {

                    _wsystem(tm0);

           }

           else if(cmdf==5)

           {

            _wsystem(tm1);

           }

       else if(cmdf==6)

           {

            _wsystem(tm2);

           }

       else if(cmdf>=7)

           {

            _wsystem(tm3);

           }

      

 

      return(0);

}

 

 

int    nospacef(wchar_t    *cmdb)

{

       int    s,d;

       wchar_t   tmpb[5000];

 

 

           if(cmdb[0]<L' ') return(0);

 

           while(1)

           {

                   if(cmdb[0]<L' ') break;

                   if(cmdb[0]==L' ') {wcscpy(cmdb,&cmdb[1]);continue;}

                   else  break;

           }

 

           for(d=0,s=0;s<5000;)

           {

                   if(cmdb[s]<L' ')  {tmpb[d]=cmdb[s];break;}

                   else if((cmdb[s]==L' ') && (cmdb[s+1]==L' ')) {++s;continue;}

           else  {tmpb[d]=cmdb[s];++d;++s;}

 

           }

           if(tmpb[0]==L' ') wcscpy(cmdb,&tmpb[1]);else wcscpy(cmdb,tmpb);

 

           return(0);

}

 

int   chdrive(wchar_t *cmdb)

{

       int   drive;

       wchar_t   a;

 

           if(_usrpcf==1) return(0);

           if(cmdb[0]<L' ') return(0);

 

       a=towlower(cmdb[0]);drive=a-L'a'+1;

           _chdrive(drive);

       _wgetdcwd(drive,cdirb,_MAX_DIR);

           if((cdirb[0]==L'\\') && (cdirb[1]==L'\\') && (cmdb[2]>L' '))

                {wcscpy(uncb,cdirb);uncdir(uncb,cdirb);}

           else dirunc(cdirb,uncb);

 

 

       return(0);

}

 

int   pcname(wchar_t *cmdb,wchar_t *usrpcb)

{

     int    i,j;

     wchar_t  tm[5000];

 

         if((cmdb[0]!=L'\\') || (cmdb[1]!=L'\\')  || (cmdb[2]<L' '))

         {

                 wcscpy(usrpcb,logonserver);_usrpcf=0;

         return(0);

         }

         tm[0]=L'\\';tm[1]=L'\\';

         for(i=2,j=2;i<5000;++i)

         {

          if( cmdb[i]==L'\\' || cmdb[i]<L' ')

                  {

                          tm[j]=L'\0';break;

                  }

                  else tm[j++]=cmdb[i];

         }

     _wcslwr(tm);wcscpy(usrpcb,tm);

         if(wcsicmp(usrpcb,logonserver)==0) _usrpcf=0; else  _usrpcf=1;

 

     return(0);

}

 

int   cdtest(wchar_t *cmdb)

{

 

      if(_wchdir(cmdb)==(-1)) wprintf(L"cdtest() cdir _wchdir err!  cdirb=%s\r\n\0",cmdb);

          cdrive=_getdrive();

      if(_wgetdcwd(cdrive,cdirb,_MAX_DIR)==NULL)

                  {wprintf(L"Err! cdf() _wgetcwd()----->> cdirb=%s\n",cdirb );return(1);}

          else wprintf(L"cdir=%s\n",cdirb);

          if((cdirb[0]==L'\\') && (cdirb[1]==L'\\') && (cdirb[2]>L' '))

          { wcscpy(uncb,cdirb);uncdir(uncb,cdirb);}

          else

                  dirunc(cdirb,uncb);

      return(0);

 

}

 

wchar_t    *cwdf(void)

{

     cdrive=_getdrive();

        if(_wgetdcwd(cdrive,cdirb,_MAX_DIR)==NULL)

             {wprintf(L"Err! cwdf()  _getdcwd() cdirb=%s err!",cdirb);}

        return(cdirb);

}

 

int   pwdf(void)

{

     

    cdrive=_getdrive();

        if(_wgetdcwd(cdrive,cdirb,_MAX_DIR)==NULL)

             {wprintf(L"Err! pwdf()  _getdcwd() cdirb=%s err!",cdirb);}

        wcscpy(tmcdirb,cdirb);

    nospacef(cdirb);

        wprintf(L"pwd=%s uncb=%s  guncb=%s\n",cdirb,uncb,guncb);

 

 

 

 

    return(0);

}

 

extern   int   cdf(wchar_t  *cmdb)

{

 

        int  i;

 

        for(i=0;i<5000;i++)

        {

                if(cmdb[i]<' ') {cmdb[i]=L'\0';break;}

                else if(cmdb[i]==L'\"') wcscpy(&cmdb[i],&cmdb[i+1]);

        }

 

 

 

 

        if(cmdb[0]<L' ')

        {

                cdrive=_getdrive();

            if(_wgetdcwd(cdrive,cdirb,_MAX_DIR)==NULL)

                     {wprintf(L"Err! cdf() _wgetdcwd() -----> cdirb=%s\r\n",cdirb);}

        dirunc(cdirb,uncb);

            pcname(uncb,usrpcb);

                         

                if(_usrpcf==0)

        {

                 if((cdirb[0]==L'\\') && (cdirb[1]==L'\\') && (cdirb[2]>L' '))

                 {   

                                  wcscpy(uncb,cdirb);

                      uncdir(uncb,cdirb) ;

                 }

                 else  

                 {

                          dirunc(cdirb,uncb)  ;

                 }

 

             }

             if(_usrpcf==1)

                 wcscpy(guncb,cmdb);

         wprintf(L"\ncdirb=%s\ncuncb=%s\nguncb=%s\n",cdirb,uncb,guncb);return(0);

        }

 

    nospacef(cmdb);

    enn(cmdb);

 

 

        if((cmdb[0]==L'\\') && (cmdb[1]==L'\\') && (cmdb[2]>L' '))

        {

                wcscpy(uncb,cmdb);

                pcname(cmdb,usrpcb);

                if(_usrpcf==0)

                {

                        uncdir(uncb,cdirb);

                        if(_wchdir(cdirb)==(-1))

                        {

                                wprintf(L"Err! cdf() _wchdir err!  cdirb=%s\r\n\0",cdirb);

                        }

                }

                else if(_usrpcf==1)

                {

             wcscpy(guncb,cmdb);

                }

        }

    else

        {

                if(_wchdir(cmdb)==(-1))

                {

                        wprintf(L" Err! cdf() _wchdir() err! cmdb=%s \r\n\0",cmdb);

                        wcscpy(cdirb,cmdb);return(0);

                }

                else

                {

                         cdrive=_getdrive();

                 if(_wgetdcwd(cdrive,cdirb,_MAX_DIR)==NULL)

                           {wprintf(L"Err! cdf() _wgetdcwd() -----> cdirb=%s\r\n",cdirb);}

                     dirunc(cdirb,uncb);

 

                       

                        if(cdhistno>=39) cdhistno=1;

                         wcscpy(cdhist[cdhistno++],cdirb);

        }

    }

 

        return(0);

}

 

int   cdhistf(void)

{

        int    i;

        wchar_t  line[1024];

 

                for(i=0;i<50;++i)

                {

             wprintf(L"\n%02d %s",i,cdhist[i]);

                }

                wprintf(L"\nCD Dir No.= ? # "); _getws(line);    

        i=_wtoi(line);

                if(i<0) i=0;

                if(i>49) i=49;

                cdf(cdhist[i]);

 

                return(0);

}

 

int   cmdhistf(wchar_t *cmdb)

{

        int    i;

        wchar_t  line[1024];

 

                for(i=0;i<50;++i)

                {

             wprintf(L"\n%02d %s",i,cmdhist[i]);

                }

                wprintf(L"\nCMDHist No.= ? # "); _getws(line);    

        i=_wtoi(line);

                if(i<0) i=0;

                if(i>49) i=49;

                wcscpy(cmdb,cmdhist[i]);

                if(cmdb[0]<L' ') return(1);

 

                return(0);

}

 

int   uncdir(wchar_t *uncb,wchar_t *cdirb)

{

     int    i,j;

 

          if(uncb[0]<L' ') return(0);

          if((uncb[0]!=L'\\') && (uncb[1]!=L'\\') && (uncb[2]<L' ' ))

          {

                  return(0);

          }

 

          for(i=2,j=0;i<_MAX_DIR;++i)

          {

                  if(uncb[i]<L' ') break;

          else if(uncb[i]==L'$')

                  {

                          uncb[i]=L':';

                          wcscpy(cdirb,&uncb[i-1]);

              uncb[i]=L'$';

                         

                          break;

                  }

          else if(uncb[i]==L'\\')

                  {

                          ++j;

                          if(j>=2){

                                  cdirb[0]=uncb[i-1];

                                  cdirb[1]=L':';

                                  wcscpy(&cdirb[2],&uncb[i]);                    

                          break;

                          }

                  }

 

          }

     return(0);

}

 

int   dirunc(wchar_t *cdirb, wchar_t *uncb)

{

    wchar_t  tmcdirb[1024];

 

    cdrive=_getdrive();

        if(_wgetdcwd(cdrive,cdirb,_MAX_DIR)==NULL) {wprintf(L"dirrun() _getdcwd() cdir=%s\r\n",cdirb);}

       

    nospacef(cdirb);

    wcscpy(tmcdirb,cdirb);

    pcname(cdirb,usrpcb);

        if((cdirb[0]==L'\\') && (cdirb[1]==L'\\') && (cdirb[2]>L' '))

        {

                if(_usrpcf==1)          wcscpy(uncb,cdirb);

                else wcscpy(uncb,cdirb);

                return(0);

        }

 

        if(cdirb[0]<L' ')   {wprintf(L"Err! cdir=NULL  \r\n");}

    if(cdirb[0]<L'A' || cdirb[0]>L'z')  {wprintf(L"Err! dirunc() NO Drive \r\n");}

        if(cdirb[1]==L':')

              tmcdirb[1]=L'$';     

        else {wprintf(L"Err! No : \r\n");}

 

 

 

    wcscpy(uncb,usrpcb);wcscat(uncb,L"\\");wcscat(uncb,tmcdirb);

 

     return(0);

}

 

extern int    setf(wchar_t   *cmdb)

{

 

        int    i,wa=0;

 

        wchar_t    tmb0[5000];

       

    wcscpy(tmb0,cmdb);

 

        for(i=0,wa=0;i<5000;++i)

        {

          if(tmb0[i]==L'=') ++wa;

                  else if(tmb0[i]==L'\0') break;

                  else if(tmb0[i]<L' ') {tmb0[i]=L'\0';break;}

        }

 

        if(wa>=1) _wputenv(cmdb);

    if(wa==0) 

        {

                if(_wgetenv(tmb0)==NULL) wprintf(L"\n環境変数%sは存在登録されていません。",tmb0);

                else  wprintf(L"\n%s",_wgetenv(tmb0));

        }

    return(0);

}

 

int  cmdfmain(int argc, wchar_t **argv,wchar_t **envp)

{

           wchar_t    cmdb[5000];

    

    cdrive=_getdrive();

        if(_wgetdcwd(cdrive,home,_MAX_DIR)==NULL)

            {wprintf(L"Err! cmdfmain() _getcwd() home=%s \n",home);

                wcscpy(home,L"No Home!\n");}

    wprintf(L"home=%s\n",home);

 

    if((home[0]==L'\\') && (home[1]==L'\\') && (home[2]>L' '))

        wcscpy(uncb,home);

        else

                wcscpy(cdirb,home);

       

 

    if(inif()==1)  return(1);

 

        if(cmdf(cmdb)==1)  return(1);

       

        return 0;

}

 

wchar_t   *enn(wchar_t  *cmdb)

{

       int   i;

 

        // if(cmdb[0]<L' ') return(1);

 

     for(i=1;i<1020;++i)

         {

                 if(cmdb[i]<L' ')

                 {cmdb[i]=L'\0';cmdb[i+1]=L'\0';cmdb[i+2]=L'\0';break;}

         }

 

        return(cmdb);

}

 

int    dor(wchar_t  *cmdb)

{

       int   i;

 

         if(cmdb[0]<L' ') return(0);

         if((cmdb[0]==L'\\') && (cmdb[1]<L' ')) return(1);

     for(i=1;i<5000;++i)

         {

                 if(cmdb[i]<L' ') {cmdb[i]=L'\0';break;}

        

                 if((cmdb[i]==L'$') && (cmdb[i+1]==L'\\') && (cmdb[i+2]<L' ')) return(1);

         if((cmdb[i]==L':') && (cmdb[i+1]==L'\\') && (cmdb[i+2]<L' ')) return(1);

 

         }

 

        return(0);

}

 

int    norootf(wchar_t  *cmdb)

{

       int   i;

 

         if(cmdb[0]<L' ') return(0);

         if((cmdb[0]==L'\\') && (cmdb[1]<L' ')) {cmdb[0]=L'\0';return(0);}

     for(i=1;i<5000;++i)

         {

                 if(cmdb[i]<L' ') {cmdb[i]=L'\0';break;}

                 if((cmdb[i]==L'\\') && (cmdb[i+1]<L' ')) {cmdb[i]=L'\0';break;}

                 

         }

 

        return(0);

}

 

 

int   attribf(int    mode,wchar_t  *cmdb)

{

          int            i=0;

          int      fileend=0;

          int         bkno=7;

 

          int     afiletop=11;

 

          wchar_t     line[1024];

//        wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

//        wchar_t     tmb1[1024];

      wchar_t     tmb2[1024];

         

          FILE     *yomikomi,*kakikomi;

 

       wcscpy(tmb,cmdb);

           if(wcscmp(cmdb,L"")==0)  wcscpy(cmdb,cdirb);

           if((cmdb[0]!=L'\\') &&  (cmdb[1]!=L':'))

                   swprintf(cmdb,L"%s\\%s",cdirb,tmb);

 

      enn(cmdb);

          cdf(cmdb);

        // _wchdir(cmdb);

 

    

      fnamechf(cmdb);enn(cmdb);

        swprintf(tmb,L"%s\\excdir\\attribtx.txt",temp);

         //pcname(cdirb,usrpcb);

    if(_kannjif==0)

        {

        wprintf(L"_kannji==0\n");

           if(_usrpcf==0)

           {

                  if(_fnamef==0)

                        if(mode==0)

                              swprintf(tmb2,L"attrib %s\\*.* > %s\\excdir\\attribtx.txt",cmdb,temp);

                        else if(mode==1)

                              swprintf(tmb2,L"attrib /s %s\\*.* > %s\\excdir\\attribtx.txt",cmdb,temp);

                   else if(_fnamef==1)

                if(mode==0)

                              swprintf(tmb2,L"attrib \"%s\\*.*\" > %s\\excdir\\attribtx.txt",cmdb,temp);

                        else if(mode==1)

                              swprintf(tmb2,L"attrib /s \"%s\\*.*\" > %s\\excdir\\attribtx.txt",cmdb,temp);

                 

           }

           else  if(_usrpcf==1)

           {

                  if(_fnamef==0)

                        swprintf(tmb2,L"dir /A: %s > %s\\excdir\\dir.txt",guncb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

           }   

 

         _wsystem(tmb2);

        }

        if(_kannjif==11)

        {

          wprintf(L"_kannji==11\n");

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\attribtx.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\attribtx.txt",temp,temp);

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\attribkj.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\attribkj.txt",temp,temp);

       

          _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\attribtx.txt",temp);

      _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\attribkj.txt",temp);

      _wsystem(tmb2);

 

        }

 

         

         

      swprintf(tmb2,L"%s\\excdir\\attribno.txt",temp);

 

         

      if((yomikomi=_wfopen(tmb,L"r"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb);

         

      if((kakikomi=_wfopen(tmb2,L"w"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb2);

         

          for(i=1;i<5000;++i)

          {

                  if(fgetws(dirb[i],1024,yomikomi)==NULL) {fileend=i-1; break;}

          else

                  {

               swprintf(line,L"%04d %s",i,dirb[i]);

                           wprintf(L"%s",line);

                       fputws(line,kakikomi);

                  }

          }

 

          fclose(yomikomi);

          fclose(kakikomi);

 

          if(fileend>300)

          {

          swprintf(tmb,L"%s  \"%s\\excdir\\attribno.txt\"",note,temp);_wsystem(tmb);

 

          }

 

    while(1)

          {

          i=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@ATTRIB/RUN Line No.= ? ");_getws(tmb);

 

          if(tmb[0]==L'@') return(0);

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {attribf(0,cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]<L'0' || tmb[0]>L'9')

          {

                 //swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                  _wsystem(tmb);continue;

          }

          else

          {  i=_wtoi(tmb);bkno=i;_kannjif=0;}

 

 

ESTA:

         

          if(i<=0) return(0);

      wprintf(L"%s\n",dirb[i]);

 

        //  if(i<6) dirf(cmdb);

 

        //  if(i>(fileend-2)) return(0);

     

    

                //  wprintf(L"%s",&dirb[i][dirtop]);

                  wprintf(L"%s\n",&dirb[i][afiletop]);

          wcscpy(line,&dirb[i][afiletop]);//fnamechf(line2);

 

       

        if(_usrpcf==0)

                {

                 // if(dor(cmdb)==0)

           //    swprintf(line2,L"%s\\%s",cmdb,&dirb[i][filetop]);

        //  if(dor(cmdb)==1)

                          swprintf(line,L"%s",&dirb[i][afiletop]);

                }

        if(_usrpcf==1)

                {

                 // if(dor(guncb)==0)

          //     swprintf(line2,L"%s\\%s",guncb,&dirb[i][filetop]);

        //  if(dor(guncb)==1)

                          swprintf(line,L"%s",&dirb[i][afiletop]);

                }

 

//              if(_cdirf==0)

//              {

//                      wcscpy(line2,&dirb[i][filetop]);

//              }

           fnamechf(line);enn(line);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line);

                else if(_fnamef==0)

                        wcscpy(line3,line);

        //      if(dirb[i][afiletop]<L' ') return(0);

                if(_kannjif==11) 

                  {

                          kannji(line);

                  }

                else if(_kannjif==0)

                  {_wsystem(line);}           // line2);

       

 

          }

      return(0);

}

 

int   linedf(wchar_t  *tmb)

{

 

       if(wcsncmp(tmb,L"@ex ",4)==0)   {_lineno=_wtoi(&tmb[4]);_cmdmodef=10;return(1);}

 

 

 

 

 

       return(0);

}

 

int   linef(wchar_t   *tmb)

{

          //int   i;

 

              _lineno=0;_cmdmodef=0;

 

          if(wcsncmp(tmb,L"@type ",6)==0)         {_lineno=_wtoi(&tmb[6]);_cmdmodef=1 ;return(1);}

                  else if(wcsncmp(tmb,L"@TYPE ",6)==0)    {_lineno=_wtoi(&tmb[6]);_cmdmodef=1 ;return(1);}

                  else if(wcsncmp(tmb,L"@print ",7)==0)   {_lineno=_wtoi(&tmb[7]);_cmdmodef=2 ;return(1);}

                  else if(wcsncmp(tmb,L"@PRINT ",7)==0)   {_lineno=_wtoi(&tmb[7]);_cmdmodef=2 ;return(1);}

                  else if(wcsncmp(tmb,L"@attrib ",8)==0)  {_lineno=_wtoi(&tmb[8]);_cmdmodef=4 ;return(1);}

                  else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)  {_lineno=_wtoi(&tmb[8]);_cmdmodef=4 ;return(1);}

                  else if(wcsncmp(tmb,L"@note ",6)==0)    {_lineno=_wtoi(&tmb[6]);_cmdmodef=8 ;return(1);}

                  else if(wcsncmp(tmb,L"@NOTE ",6)==0)    {_lineno=_wtoi(&tmb[6]);_cmdmodef=9 ;return(1);}

                  else if(wcsncmp(tmb,L"@ie ",4)==0)      {_lineno=_wtoi(&tmb[4]);_cmdmodef=16;return(1);}

                  else if(wcsncmp(tmb,L"@IE ",4)==0)      {_lineno=_wtoi(&tmb[4]);_cmdmodef=16;return(1);}

                  else if(wcsncmp(tmb,L"@spawn ",7)==0)   {_lineno=_wtoi(&tmb[7]);_cmdmodef=20;return(1);}

                        

 

 

    

       return(0);

}

 

int   dirf(wchar_t  *cmdb)

{

          int            i=0;

          int      fileend=0;

          int         bkno=7;

          wchar_t     line[1024];

          wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

          wchar_t     tmb1[1024];

      wchar_t     tmb2[1024];

         

          FILE     *yomikomi,*kakikomi;

 

 

      if(_cmdendf!=0)  return(0);

      _cmdmodef=0;

 

       wcscpy(tmb,cmdb);

           if(wcscmp(cmdb,L"")==0)  wcscpy(cmdb,cdirb);

           if((cmdb[0]!=L'\\') &&  (cmdb[1]!=L':'))

                   swprintf(cmdb,L"%s\\%s",cdirb,tmb);

 

 

 

      enn(cmdb);cdf(cmdb);

        // _wchdir(cmdb);

   //   enn(cdirb);

    

      fnamechf(cmdb);enn(cmdb);

        swprintf(tmb,L"%s\\excdir\\dir.txt",temp);

         //pcname(cdirb,usrpcb);

    if(_kannjif==0)

        {

        wprintf(L"_kannji==0\n");

           if(_usrpcf==0)

           {

                  if(_fnamef==0)

                   //   swprintf(tmb2,L"dir /A: %s > \\excdir\\dir.txt",cmdb,systemdrive);

                   swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

           }

           else  if(_usrpcf==1)

           {

                  if(_fnamef==0)

                        swprintf(tmb2,L"dir /A: %s > %s\\excdir\\dir.txt",guncb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

           }   

 

         _wsystem(tmb2);

        }

        if(_kannjif==11)

        {

          wprintf(L"_kannji==11\n");

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

       

          _wsystem(tmb2);

     //  swprintf(tmb2,L"type %s\\excdir\\dir.txt",temp);

     // _wsystem(tmb2);

     //  swprintf(tmb2,L"type %s\\excdir\\dirkj.txt",temp);

     // _wsystem(tmb2);

 

        }

 

         

         

      swprintf(tmb2,L"%s\\excdir\\dirno.txt",temp);

 

         

      if((yomikomi=_wfopen(tmb,L"r"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb);

         

      if((kakikomi=_wfopen(tmb2,L"w"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb2);

         

          for(i=1;i<5000;++i)

          {

                  if(fgetws(dirb[i],1024,yomikomi)==NULL) {fileend=i-1; break;}

          else

                  {

               swprintf(line,L"%04d %s",i,dirb[i]);

                           wprintf(L"%s",line);

                       fputws(line,kakikomi);

                  }

          }

 

          fclose(yomikomi);

          fclose(kakikomi);

 

          if(fileend>300)

          {

          swprintf(tmb,L"%s  %s\\excdir\\dirno.txt",note,temp);_wsystem(tmb);

 

          }

 

      while(1)

          {

                  if(_cmdendf!=0) return(0);

                  _cmdmodef=0;

          i=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@DIR/RUN Line No.= ? ");_getws(tmb);

 

          if(tmb[0]==L'?') {dirf(cmdb);return(0);}

          if(tmb[0]==L' ') {dirf(cmdb);return(0);}

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {dirf(cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]==L'@')

          {

                       if(wcsncmp(tmb,L"@attrib /s ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if( wcscmp(tmb,L"@attrib")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB /S ",11)==0)   {attribf(1,&tmb[11]);continue;}

        //        else if(wcsncmp(tmb,L"@attrib ",8)==0)       {attribf(0,&tmb[8]);continue;}

        //        else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if( wcscmp(tmb,L"@ATRRIB")==0)          {attribf(0,cmdb);continue;}

        //        else if(wcsncmp(tmb,L"@type ",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;}

        //        else if(wcsncmp(tmb,L"@print ",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=2;goto ESTA2;}

        //        else if(wcsncmp(tmb,L"@attrib ",8)==0) {i=_wtoi(&tmb[8]);_cmdmodef=4;goto ESTA2;}

        //        else if(wcsncmp(tmb,L"@note ",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=8;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@xcopy$",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1001;goto ESTA;}

                  else if(wcsncmp(tmb,L"@xcopy#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1002;goto ESTA;}

                  else if(wcsncmp(tmb,L"@dir ",5)==0)    {i=_wtoi(&tmb[5]);goto ESTA;}

                  else if(wcsicmp(tmb,L"@end")==0)       {_cmdendf=1;break;}

          else if(wcsicmp(tmb,L"@exit")==0)     

                  {   _cmdendf=1;_exitf=1;

                  wcscpy(bkcdirb,cdirb);          

                      break;

                  }

 

          if(linedf(tmb)>=1) {i=_lineno;printf("i=%d",i);goto ESTA2 ;}

                  if(linef(tmb)>=1)  {i=_lineno;printf("i=%d",i);goto ESTA2;}

 

                 

 

                  swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                  _wsystem(tmb);continue;

          }

          else

          {  i=_wtoi(tmb);bkno=i;_kannjif=0;}

 

 

ESTA:

          wprintf(L"%s",dirb[i]);

          if(i<=0) return(0);

          if(i<6) dirf(cmdb);

 

          if(i>(fileend-2)) return(0);

     

      if(wcsncmp(&dirb[i][dirtop],L"<DIR>",5)==0)    // DIR

          {

                  _dirfilef=1;

                  if(_cmdmodef==1001) {_xcopyf[0]=1,_xcopyf[1]=1;}

          if(_cmdmodef==1002) _xcopyf[2]=1;

 

                  wprintf(&dirb[i][dirtop]);

               

                  wcscpy(line,&dirb[i][filetop]);

                       

                  fnamechf(line);

                  enn(line);

        //  norootf(cmdb);

                  if(_usrpcf==0)

                  {

                  if(dor(cmdb)==0)

                               swprintf(line2,L"%s\\%s",cmdb,line);

                      else if(dor(cmdb)==1)

                  swprintf(line2,L"%s%s",cmdb,line);

                  }

                  else if(_usrpcf==1)

                  {

              if(dor(guncb)==0)

                           swprintf(line2,L"%s\\%s",guncb,line);

                       else if(dor(guncb)==1)

                    swprintf(line2,L"%s%s",guncb,line);

                  }

 

 

          enn(line2);

                  wprintf(L"dirf() line2=%s\r\n",line2);

         fnamechf(line2);

         if(_kannjif==11)

                 {

                       swprintf(line3,L"dir \"%s\" > %s\\excdir\\dir.txt && type %s\\excdir\\dir.txt",line2,temp,temp);

                         //  swprintf(line3,L"dir %s > %s\\excdir\\dirkj.txt",line2,temp);

                           wprintf(L"dirf() kannji %s",line3);

                       kannji(line3);

                 }

                 else  if(_kannjif==0)

                 {

                         

                        ;// dirf(line2);

                 }     

 

 

                 if(_cmdmodef==1001) {wcscpy(xcopysb[0],line2);continue;}

                 if(_cmdmodef==1002) {wcscpy(xcopysb[1],line2);systemf(_cmdmodef,cmdb);continue;}

                 dirf(line2); cdf(cmdb);

                 

          }

          else // NO DIR

      {

                  _dirfilef=0;

                  if(_cmdmodef==1001) {_xcopyf[0]=1;_xcopyf[1]=0;}

          if(_cmdmodef==1002) _xcopyf[2]=0;

                  wprintf(L"%s",&dirb[i][dirtop]);

                  wprintf(L"%s",&dirb[i][filetop]);

ESTA2:    wcscpy(line,&dirb[i][filetop]);//fnamechf(line2);

 

       

        if(_usrpcf==0)

                {

                  if(dor(cmdb)==0)

               swprintf(line2,L"%s\\%s",cmdb,&dirb[i][filetop]);

          if(dor(cmdb)==1)

                          swprintf(line2,L"%s%s",cmdb,&dirb[i][filetop]);

                }

        if(_usrpcf==1)

                {

                  if(dor(guncb)==0)

               swprintf(line2,L"%s\\%s",guncb,&dirb[i][filetop]);

          if(dor(guncb)==1)

                          swprintf(line2,L"%s%s",guncb,&dirb[i][filetop]);

                }

 

       

        fnamechf(line2);enn(line2);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line2);

                else if(_fnamef==0)

                        wcscpy(line3,line2);

                if(line3[0]<L' ') return(0);

        enn(line3);

                if(_cmdmodef==1001) {wcscpy(xcopysb[0],line3);continue;}

        if(_cmdmodef==1002) {wcscpy(xcopysb[1],line3);}

 

 

                if(_kannjif==11) 

                  {

                          kannji(line3);

                  }

                else if(_kannjif==0)

                  {systemf(_cmdmodef,line3);}           // line2);

        }

          }//while  end

 

      return(0);

}

 

int   xdirf(int  xmode,wchar_t  *cmdb)

{

          int            i=0,j;

          int      fileend=0;

          int         bkno=7;

          int         purasu=0;

      int          xdirbf=0;

 

 

 

          wchar_t     line[1024];

          wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

          wchar_t     tmb1[1024];

      wchar_t     tmb2[1024];

      wchar_t     xchar[10];

         

          FILE     *yomikomi,*kakikomi;

 

 

      if(_cmdendf!=0)  return(0);

 

 

       _cmdmodef=0;xdirbf=0;

 

       if(xmode==0) {wcscpy(xchar,L"C");purasu=0;}

       else if(xmode==1) {wcscpy(xchar,L"Q");purasu=23;}

       else if(xmode==2) {wcscpy(xchar,L"S");purasu=0; }

           else if(xmode==3) {wcscpy(xchar,L"X");purasu=13;}

       else if(xmode==4) {wcscpy(xchar,L"T:C");purasu=0;}

       else if(xmode==5) {wcscpy(xchar,L"T:A");purasu=0;}

       else if(xmode==6) {wcscpy(xchar,L"T:W");purasu=0;}

       else if(xmode==7) {wcscpy(xchar,L"B");purasu=-36;}    //filetop=36

 

 

            wcscpy(tmb,cmdb);

           if(wcscmp(cmdb,L"")==0)  wcscpy(cmdb,cdirb);

           if((cmdb[0]!=L'\\') &&  (cmdb[1]!=L':'))

                   swprintf(cmdb,L"%s\\%s",cdirb,tmb);

 

      enn(cmdb);cdf(cmdb);

        // _wchdir(cmdb);

   //   enn(cdirb);

    

      fnamechf(cmdb);enn(cmdb);

        swprintf(tmb,L"%s\\excdir\\dir.txt",temp);

         //pcname(cdirb,usrpcb);

    if(_kannjif==0)

        {

        wprintf(L"_kannji==0\n");

           if(_usrpcf==0)

           {

                  if(_fnamef==0)

                  {

                //        if(xmode==0)

                //        {

                //                purasu=0;

                           swprintf(tmb2,L"dir /A /%s %s > %s\\excdir\\dir.txt",xchar,cmdb,temp);

                   //       swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

                ///       }

                //        else if(xmode==1)

                //        {

                //                purasu=23;

         //         swprintf(tmb2,L"dir /A /Q %s > %s\\excdir\\dir.txt",cmdb,temp);

                //       }

                //        else if(xmode==2)

                //        {

                //                 purasu=0;

                 //          swprintf(tmb2,L"dir /A /S %s > %s\\excdir\\dir.txt",cmdb,temp);

                //        }    

                //        else if(xmode==3)

                //        {

                //                 purasu=13;

                 //          swprintf(tmb2,L"dir /A /X %s > %s\\excdir\\dir.txt",cmdb,temp);

                //        }    

                  }

                  else if(_fnamef==1)

          {

        //      if(xmode==0)

                //        {

                //                purasu=0;

                           swprintf(tmb2,L"dir /A /%s \"%s\" > %s\\excdir\\dir.txt",xchar,cmdb,temp);

                   //       swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

                //        }

                //        else if(xmode==1)

                //        {

                //                purasu=23;

         //         swprintf(tmb2,L"dir /A /Q \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

                //        }

                //        else if(xmode==2)

                //        {

                //                 purasu=0;

                 //          swprintf(tmb2,L"dir /A /S \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

                //        }    

                //        else if(xmode==3)

                //        {

                //                 purasu=13;

                //           swprintf(tmb2,L"dir /A /X \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

                //        }    

           

             // swprintf(tmb2,L"dir /A \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

          

                  }

           }

           else  if(_usrpcf==1)

           {

                  if(_fnamef==0)

                  {

                        //  if(xmode==0)

                        //  {

                         //       purasu=0;

                           swprintf(tmb2,L"dir /A /%s %s > %s\\excdir\\dir.txt",xchar,cmdb,temp);

                   //       swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

                //        }

                //        else if(xmode==1)

                //        {

                //                purasu=23;

          //        swprintf(tmb2,L"dir /A /Q %s > %s\\excdir\\dir.txt",cmdb,temp);

                //        }

                //        else if(xmode==2)

                //        {

                //                 purasu=0;

                 //          swprintf(tmb2,L"dir /A /S %s > %s\\excdir\\dir.txt",cmdb,temp);

                //        }    

                //        else if(xmode==3)

                //        {

                //                 purasu=13;

                 //          swprintf(tmb2,L"dir /A /X %s > %s\\excdir\\dir.txt",cmdb,temp);

        //                }    

                      //  swprintf(tmb2,L"dir /A %s > %s\\excdir\\dir.txt",guncb,temp);

                  }

                  else if(_fnamef==1)

                  {

                //        if(xmode==0)

                //        {

                //                purasu=0;

                           swprintf(tmb2,L"dir /A /%s \"%s\" > %s\\excdir\\dir.txt",xchar,cmdb,temp);

                   //       swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

        //                }

        //                else if(xmode==1)

        //                {

        //                        purasu=23;

     //             swprintf(tmb2,L"dir /A /Q \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

        //                }

        //                else if(xmode==2)

        //                {

        //                         purasu=0;

        //                 swprintf(tmb2,L"dir /A /S \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

        //                }    

        //                else if(xmode==3)

        //                {

        //                         purasu=13;

        //                 swprintf(tmb2,L"dir /A /X \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

        //                }    

              //swprintf(tmb2,L"dir /A \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

                  }    

       }

         _wsystem(tmb2);

        }

        if(_kannjif==11)

        {

      

       if(xmode==0) {wcscpy(xchar,L"C");purasu=0;}

       else if(xmode==1) {wcscpy(xchar,L"Q");purasu=23;}

       else if(xmode==2) {wcscpy(xchar,L"S");purasu=0; }

           else if(xmode==3) {wcscpy(xchar,L"X");purasu=13;}

       else if(xmode==4) {wcscpy(xchar,L"T:C");purasu=0;}

       else if(xmode==5) {wcscpy(xchar,L"T:A");purasu=0;}

       else if(xmode==6) {wcscpy(xchar,L"T:W");purasu=0;}

       else if(xmode==7) {wcscpy(xchar,L"B");purasu=-36;}    //filetop=36

 

 

       swprintf(tmb2,L"dir /A /%s \"%s\" > %s\\excdir\\dir.txt",xchar,cmdb,temp);

       kannji(tmb2);

 

          wprintf(L"_kannji==11\n");

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

       

          _wsystem(tmb2);

          swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd",temp);filenullf(tmb2);

 

 

     //  swprintf(tmb2,L"type %s\\excdir\\dir.txt",temp);

     // _wsystem(tmb2);

     //  swprintf(tmb2,L"type %s\\excdir\\dirkj.txt",temp);

     // _wsystem(tmb2);

 

        }

 

         

         

      swprintf(tmb2,L"%s\\excdir\\dirno.txt",temp);

 

         

      if((yomikomi=_wfopen(tmb,L"r"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb);

         

      if((kakikomi=_wfopen(tmb2,L"w"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb2);

         

          for(i=1;i<5000;++i)

          {

                  if(fgetws(dirb[i],1024,yomikomi)==NULL) {fileend=i-1; break;}

          else

                  {

               swprintf(line,L"%04d %s",i,dirb[i]);

                           wprintf(L"%s",line);

                       fputws(line,kakikomi);

                  }

          }

 

          fclose(yomikomi);

          fclose(kakikomi);

 

          if(fileend>300)

          {

          swprintf(tmb,L"%s  %s\\excdir\\dirno.txt",note,temp);_wsystem(tmb);

 

          }

 

      while(1)

          {

                  if(_cmdendf!=0) return(0);

                  _cmdmodef=0;

          i=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@DIR/A/%s@RUN Line No.= ? ",xchar);_getws(tmb);

 

          if(tmb[0]==L'?') {dirf(cmdb);return(0);}

          if(tmb[0]==L' ') {dirf(cmdb);return(0);}

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {dirf(cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]==L'@')

          {

                       if(wcsncmp(tmb,L"@attrib /s ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if( wcscmp(tmb,L"@attrib")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB /S ",11)==0)   {attribf(1,&tmb[11]);continue;}

        //        else if(wcsncmp(tmb,L"@attrib ",8)==0)       {attribf(0,&tmb[8]);continue;}

        //        else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if( wcscmp(tmb,L"@ATRRIB")==0)          {attribf(0,cmdb);continue;}

        //        else if(wcsncmp(tmb,L"@type ",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;}

        //        else if(wcsncmp(tmb,L"@print ",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=2;goto ESTA2;}

        //        else if(wcsncmp(tmb,L"@attrib ",8)==0) {i=_wtoi(&tmb[8]);_cmdmodef=4;goto ESTA2;}

        //        else if(wcsncmp(tmb,L"@note ",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=8;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@xcopy$",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1001;goto ESTA;}

                  else if(wcsncmp(tmb,L"@xcopy#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1002;goto ESTA;}

                  else if(wcsncmp(tmb,L"@dir ",5)==0)    {i=_wtoi(&tmb[5]);goto ESTA;}

                  else if(wcsicmp(tmb,L"@end")==0)       {_cmdendf=1;break;}

          else if(wcsicmp(tmb,L"@exit")==0)     

                  {   _cmdendf=1;_exitf=1;

                  wcscpy(bkcdirb,cdirb);          

                      break;

                  }

          if(linedf(tmb)>=1) {i=_lineno;printf("i=%d",i);goto ESTA2 ;}

                  if(linef(tmb)>=1)  {i=_lineno;printf("i=%d",i);goto ESTA2;}

 

                 

 

                  swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                  _wsystem(tmb);continue;

          }

          else

          {  i=_wtoi(tmb);bkno=i;_kannjif=0;}

 

 

ESTA:

          wprintf(L"%s",dirb[i]);

          if(i<=0) return(0);

          if(i<6) dirf(cmdb);

 

          if(i>(fileend-2)) return(0);

     

          if(xmode==7)

          {

                  xdirbf=0;

                  for(j=0;j<230;++j)

                  {

                          if(dirb[i][j]<L' ') break;

                          else if(dirb[i][j]==L'.') {xdirbf=1;break;}

                  }

          }

      if((wcsncmp(&dirb[i][dirtop],L"<DIR>",5)==0) || ((xmode==7) && (xdirbf==0)))    // DIR

          {

                  _dirfilef=1;

                  if(_cmdmodef==1001) {_xcopyf[0]=1,_xcopyf[1]=1;}

          if(_cmdmodef==1002) _xcopyf[2]=1;

 

                  wprintf(&dirb[i][dirtop]);

 

               

                  wcscpy(line,&dirb[i][filetop+purasu]);

        

                //  wcscpy(line,&dirb[i][filetop]);

                 fnamechf(line);

                  enn(line);

        //  norootf(cmdb);

                  if(_usrpcf==0)

                  {

                  if(dor(cmdb)==0)

                               swprintf(line2,L"%s\\%s",cmdb,line);

                      else if(dor(cmdb)==1)

                  swprintf(line2,L"%s%s",cmdb,line);

                  }

                  else if(_usrpcf==1)

                  {

              if(dor(guncb)==0)

                           swprintf(line2,L"%s\\%s",guncb,line);

                       else if(dor(guncb)==1)

                    swprintf(line2,L"%s%s",guncb,line);

                  }

 

 

          enn(line2);

                  wprintf(L"dirf() line2=%s\r\n",line2);

         fnamechf(line2);

         if(_kannjif==11)

                 {

                        // if(xmode==0)

                         // {

                          //      purasu=0;

                           swprintf(line3,L"dir /A /%s \"%s\" > %s\\excdir\\dir.txt",xchar,line2,temp);

                   //       swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

                //        }

                //        else if(xmode==1)

                //        {

                        //        purasu=23;

          //        swprintf(line3,L"dir /A /Q \"%s\" > %s\\excdir\\dir.txt",line2,temp);

                //        }

        //                else if(xmode==2)

        //                {

        //                //       purasu=0;

        //                 swprintf(line3,L"dir /A /S \"%s\" > %s\\excdir\\dir.txt",line2,temp);

        //                }    

        //                else if(xmode==3)

        //                {

                         //        purasu=13;

        //                 swprintf(line3,L"dir /A /X \"%s\" > %s\\excdir\\dir.txt",line2,temp);

        //                }    

                     //  swprintf(line3,L"dir \"%s\" > %s\\excdir\\dir.txt && type %s\\excdir\\dir.txt",line2,temp,temp);

                         //  swprintf(line3,L"dir %s > %s\\excdir\\dirkj.txt",line2,temp);

                           wprintf(L"dirf() kannji %s",line3);

                       kannji(line3);

                 }

                 else  if(_kannjif==0)

                 {

                         

                        ;// dirf(line2);             ///////// DIR ////////////////////////////////////////////////////

                 }     

 

 

                 if(_cmdmodef==1001) {wcscpy(xcopysb[0],line2);continue;}

                 if(_cmdmodef==1002) {wcscpy(xcopysb[1],line2);systemf(_cmdmodef,cmdb);continue;}

                 xdirf(xmode,line2); cdf(cmdb);

                 

          }

          else // NO DIR

      {

                  _dirfilef=0;

                  if(_cmdmodef==1001) {_xcopyf[0]=1;_xcopyf[1]=0;}

          if(_cmdmodef==1002) _xcopyf[2]=0;

                  wprintf(L"%s",&dirb[i][dirtop]);

                  wprintf(L"%s",&dirb[i][filetop+purasu]);

ESTA2:    wcscpy(line,&dirb[i][filetop+purasu]);//fnamechf(line2);

 

       

        if(_usrpcf==0)

                {

                  if(dor(cmdb)==0)

               swprintf(line2,L"%s\\%s",cmdb,&dirb[i][filetop+purasu]);

          if(dor(cmdb)==1)

                          swprintf(line2,L"%s%s",cmdb,&dirb[i][filetop+purasu]);

                }

        if(_usrpcf==1)

                {

                  if(dor(guncb)==0)

               swprintf(line2,L"%s\\%s",guncb,&dirb[i][filetop+purasu]);

          if(dor(guncb)==1)

                          swprintf(line2,L"%s%s",guncb,&dirb[i][filetop+purasu]);

                }

 

       

        fnamechf(line2);enn(line2);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line2);

                else if(_fnamef==0)

                        wcscpy(line3,line2);

                if(line3[0]<L' ') return(0);

        enn(line3);

                if(_cmdmodef==1001) {wcscpy(xcopysb[0],line3);continue;}

        if(_cmdmodef==1002) {wcscpy(xcopysb[1],line3);}

 

 

                if(_kannjif==11) 

                  {

                          kannji(line3);

                      swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd",temp);filenullf(tmb2);

 

                  }

                else if(_kannjif==0)

                  {systemf(_cmdmodef,line3);}           // line2);

        }

          }//while  end

 

      return(0);

}

 

int    filenullf(wchar_t *fname)

{

      FILE   *kakikomi;

 

       if((kakikomi=_wfopen(fname,L"w"))==NULL)

            wprintf(L"Err! filenullf() _wfopen() No file! %s \n",fname);

        

            fputws(L" ",kakikomi);

            fclose(kakikomi);

        return(0);

}

 

int   treef(int   treeflg,wchar_t  *cmdb)

{

          int            i=0,t=0;

          int      fileend=0;

          int         bkno=7;

          int        trdirf[5000];

          int        pathsu=0;

          int       cpathsu=0;

          int          endf=0;

          wchar_t     line[1024];

          wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

//        wchar_t     tmb1[1024];

      wchar_t     tmb2[1024];

          wchar_t     tmpb[1024];

     

      div_t       div_syo;

 

          FILE     *yomikomi,*kakikomi;

 

    

      if(_treef_endf==1) return(1);

 

 

    //  enn(cmdb);

          cdf(cmdb);

        //  _wchdir(cmdb);

   //   enn(cdirb);

    

      fnamechf(cmdb);enn(cmdb);

        swprintf(tmb,L"%s\\excdir\\dir.txt",temp);

         pcname(cdirb,usrpcb);

    if(_kannjif==0)

        {

        wprintf(L"_kannji==0\n");

           if(_usrpcf==0)

           {

                  if(_fnamef==0)

                  {

                          if(treeflg==0)

                           swprintf(tmb2,L"tree /A  %s > %s\\excdir\\dir.txt",cmdb,temp);

                          else  if(treeflg>=1)

                           swprintf(tmb2,L"tree /A /F %s > %s\\excdir\\dir.txt",cmdb,temp);

                  }

                  else if(_fnamef==1)

                  {

              if(treeflg==0)

                   swprintf(tmb2,L"tree /A  \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

               else  if(treeflg>=1)

                           swprintf(tmb2,L"tree /A /F %s > %s\\excdir\\dir.txt",cmdb,temp);

                  

                  }

           }

           else  if(_usrpcf==1)

           {

                  if(_fnamef==0)

                  {

                if(treeflg==0)

                     swprintf(tmb2,L"tree /A  \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

                                else if(treeflg>=1)

                             swprintf(tmb2,L"tree /A /F %s > %s\\excdir\\dir.txt",guncb,temp);

                  }

                  else if(_fnamef==1)

                  {

                 if(treeflg==0)

                     swprintf(tmb2,L"tree /A  \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

                                 else if(treeflg>=1)                   

                      swprintf(tmb2,L"tree /A /F \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

                  }

          }    

 

    _wsystem(tmb2);

        }

        else if(_kannjif==11)

        {

          wprintf(L"_kannji==11\n");

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

       

          _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dir.txt",temp);

      _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dirkj.txt",temp);

      _wsystem(tmb2);

 

        }

 

         

         

      swprintf(tmb2,L"%s\\excdir\\dirno.txt",temp);

 

         

      if((yomikomi=_wfopen(tmb,L"r"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb);

         

      if((kakikomi=_wfopen(tmb2,L"w"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb2);

         

 

         

          for(i=1;i<5000;i++)

          {

                  if(fgetws(dirb[i],1024,yomikomi)==NULL) {fileend=i-1; break;}

          else

                  {

               swprintf(line,L"%04d %s",i,dirb[i]);

                           wprintf(L"%s",line);

                       fputws(line,kakikomi);

                          

              

                  }

 

          }

 

          fclose(yomikomi);

          fclose(kakikomi);

 

 

 

    //  _wchdir(cmdb);

           cpathsu=0;endf=0;

 

 

           for(i=1;i<5000;i++)

           {

             if(i>=fileend) break;

             trdirf[i]=0;wcscpy(trdirb[i],L"");

           }

       for(i=0;i<150;++i)

           {

                   wcscpy(pathb[i],L"");

           }

 

 

 

       wcscpy(pathb[0],dirb[3]);

           for(i=1;i<5000;i++)

           {

             if(i>=fileend) break;

              trdirf[i]=0;

                     wcscpy(tmpb,dirb[i]);//wcscpy(dirb[i],L"");

                        // _wgetcwd(trdirb[i],245);

             for(t=0,pathsu=0;t<1024;t++)

                           {

                //           if(tmpb[t]==L'|') pathsu++;

                 if((tmpb[t-4]==L'+') && (tmpb[t-3]==L'-') && (tmpb[t-2]==L'-') && (tmpb[t-1]==L'-') && (tmpb[t]!=L'-'))

                         {

          //           pathsu++;

                     div_syo=div(t,4);

 

                                        //(endf>0) {cpathsu=cpathsu-endf;endf=0;}

                                         swprintf(pathb[div_syo.quot],L"%s\\%s\n",enn(pathb[div_syo.quot-1]),&tmpb[t]);

                     trdirf[i]=1;//_wchdir(pathb[cpathsu]);//_wgetcwd(trdirb[i],245);

                     wcscpy(trdirb[i],pathb[div_syo.quot]);

                   //  wcscpy(dirb[i],pathb[div_syo.quot]);

 

 

 

                                         //_wgetcwd(dirb[i],245);

 

                                         //_wgetcwd(pathb[++cpathsu],245);

                         }

                                 else if((tmpb[t-4]==L'\\') && (tmpb[t-3]==L'-') && (tmpb[t-2]==L'-') && (tmpb[t-1]==L'-') && (tmpb[t]!=L'-'))

                         {

                     pathsu++;++endf;

                     div_syo=div(t,4);

                     swprintf(pathb[div_syo.quot],L"%s\\%s",enn(pathb[div_syo.quot-1]),&tmpb[t]);

                     trdirf[i]=1;_wchdir(pathb[div_syo.quot]);//_wgetcwd(trdirb[i],245);

                     wcscpy(trdirb[i],pathb[div_syo.quot]);

                    // wcscpy(dirb[i],pathb[div_syo.quot]);

 

                                         //swprintf(line,L"%s\\%s",pathb[cpathsu],&tmpb[t]);

                     //trdirf[i]=1;_wchdir(line);_wgetcwd(trdirb[i],245);

                                         //_wgetcwd(dirb[i],245);_wgetcwd(pathb[++cpathsu],245);

                         }

                 else if((tmpb[t-3]==L' ') && (tmpb[t-2]==L' ') && (tmpb[t-1]==L' ') && (tmpb[t]!=L' ') && (tmpb[t]!=L'+') && (tmpb[t]!=L'\\') && (tmpb[t]!=L'|') )

                         {

                             if(t>250) break;

                 div_syo=div(t,4);

                 swprintf(trdirb[i],L"%s\\%s",enn(pathb[div_syo.quot-1]),&tmpb[t]);

                 trdirf[i]=0;

                             }

                                 

                                //else   wcscpy(dirb[i],pathb[0]);//swprintf(dirb[i],L"%s\n",enn(pathb[div_syo.quot-1]));

           }

            wcscpy(dirb[i],trdirb[i]);

           if(debug==1) wprintf(L"flag=%d dirb[%d]=%s",trdirf[i],i,trdirb[i]);        

           }

      for(i=0;i<10;++i)

          {

                  wprintf(L"\npathb[%d]=%s",i,pathb[i]);

          }

 

          if(fileend>300)

          {

          swprintf(tmb,L"%s  %s\\excdir\\dirno.txt",note,temp);_wsystem(tmb);

 

          }

 

      while(1)

          {

        //  i=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@TREE/RUN Line No.= ? ");_getws(tmb);

 

          if(tmb[0]==L'?') {dirf(cmdb);return(0);}

          if((tmb[0]==L'@') && (tmb[1]< L' ')){treef(1,cmdb);return(0);}

          if(tmb[0]==L' ') {treef(1,cmdb);return(0);}

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {treef(1,cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]<L'0' || tmb[0]>L'9')

          {

                       if(wcsncmp(tmb,L"@attrib /s ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if( wcscmp(tmb,L"@attrib")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB /S ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if(wcsncmp(tmb,L"@attrib ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if( wcscmp(tmb,L"@ATRRIB")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@type#",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@print#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=2;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@attrib#",8)==0) {i=_wtoi(&tmb[8]);_cmdmodef=4;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@xcopy$",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1001;goto ESTA;}

                  else if(wcsncmp(tmb,L"@xcopy#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1002;goto ESTA;}

                  else if( wcscmp(tmb,L"@end")==0) { _treef_endf=1;return(1);}

                  else if(wcsicmp(tmb,L"@exit")==0)     

                  {   _cmdendf=1;_exitf=1;

                  wcscpy(bkcdirb,cdirb);          

                      break;

                  }

                  else    {_cmdmodef=0;}

 

 

 

 

 

                 

 

//                swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                  _wsystem(tmb);continue;

          }

          else

          {  i=_wtoi(tmb);bkno=i;_kannjif=0;}

 

 

ESTA:

          wprintf(L"%s",dirb[i]);

          if(i<=3) return(0);

         

 

          if(i>fileend) return(0);

 

 

 

 

      wcscpy(tmpb,trdirb[i]);

 

         

     

      if(trdirf[i]==1)    // DIR

          {

                  if(debug==1) wprintf(L"DIR dirb[%d]=%s",i,trdirb[i]);

                  _dirfilef=1;

                  if(_cmdmodef==1001) {_xcopyf[0]=1,_xcopyf[1]=1;}

          if(_cmdmodef==1002) _xcopyf[2]=1;

 

        //        wprintf(&dirb[i][0]);

        //        wcscpy(line,&dirb[i][0]);

        //      fnamechf(line);

        ///       enn(line);

        //  norootf(cmdb);

        //        if(_usrpcf==0)

        //        {

//                if(dor(cmdb)==0)

//                             swprintf(line2,L"%s\\%s",cmdb,line);

//                    else if(dor(cmdb)==1)

//                  swprintf(line2,L"%s%s",cmdb,line);

//                }

//                else if(_usrpcf==1)

//                {

//              if(dor(guncb)==0)

//                         swprintf(line2,L"%s\\%s",guncb,line);

//                     else if(dor(guncb)==1)

//                    swprintf(line2,L"%s%s",guncb,line);

//                }

 

 

 //         enn(line2);

//                wprintf(L"dirf() line2=%s\r\n",line2);

//         fnamechf(line2);

         if(_kannjif==11)

                 {

                       swprintf(line3,L"tree /A /F  \"%s\" > %s\\excdir\\dir.txt && type %s\\excdir\\dir.txt",line2,temp,temp);

                         //  swprintf(line3,L"dir %s > %s\\excdir\\dirkj.txt",line2,temp);

                           wprintf(L"dirf() kannji %s",line3);

                       kannji(line3);

                 }

                 else  if(_kannjif==0)

                 {

                         

                        ;// dirf(line2);

                 }     

 

 

                 if(_cmdmodef==1001) {wcscpy(xcopysb[0],line2);continue;}

                 if(_cmdmodef==1002) {wcscpy(xcopysb[1],line2);systemf(_cmdmodef,cmdb);continue;}

                 treef(treeflg,trdirb[i]); cdf(cmdb);

                 

          }    // DIR END

          else if(trdirf[i]==0)   // NO DIR

      {

                  if(debug==1) wprintf(L"NO DIR dirb[%d]=%s",i,dirb[i]);

                  _dirfilef=0;

                  if(_cmdmodef==1001) {_xcopyf[0]=1;_xcopyf[1]=0;}

          if(_cmdmodef==1002) _xcopyf[2]=0;

                  wprintf(L"%s\n" ,trdirb[i]);

                  wprintf(L"%s\n",dirb[i]);

ESTA2:    wcscpy(line,dirb[i]);//fnamechf(line2);

 

       

        if(_usrpcf==0)

                {

                  if(dor(cmdb)==0)

               swprintf(line2,L"%s\\%s",tmpb,&dirb[i][0]);

          if(dor(cmdb)==1)

                          swprintf(line2,L"%s%s",tmpb,&dirb[i][0]);

                }

        if(_usrpcf==1)

                {

                  if(dor(guncb)==0)

               swprintf(line2,L"%s\\%s",guncb,&dirb[i][0]);

          if(dor(guncb)==1)

                          swprintf(line2,L"%s%s",guncb,&dirb[i][0]);

                }

 

       

        fnamechf(line2);enn(line2);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line2);

                else if(_fnamef==0)

                        wcscpy(line3,line2);

                if(line3[0]<L' ') return(0);

        enn(line3);

                if(_cmdmodef==1001) {wcscpy(xcopysb[0],line3);continue;}

        if(_cmdmodef==1002) {wcscpy(xcopysb[1],line3);}

 

 

                if(_kannjif==11) 

                  {

                          kannji(dirb[i]);

                  }

                else if(_kannjif==0)

                  {systemf(_cmdmodef,dirb[i]);}           // line2);

        }//No Dir End.

          }//while  end

 

      return(0);

}

 

 

int   modedirf(int  mode,wchar_t  *cmdb)

{

          int            i=0;

          int      fileend=0;

          int         bkno=7;

          wchar_t     line[1024];

          wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

          wchar_t     tmb1[1024];

      wchar_t     tmb2[1024];

         

          FILE     *yomikomi,*kakikomi;

 

 

      enn(cmdb);cdf(cmdb);

        // _wchdir(cmdb);

   //   enn(cdirb);

    

      fnamechf(cmdb);enn(cmdb);

        swprintf(tmb,L"%s\\excdir\\dir.txt",temp);

         //pcname(cdirb,usrpcb);

    if(_kannjif==0)

        {

        wprintf(L"_kannji==0\n");

           if(_usrpcf==0)

           {

                  if(_fnamef==0)

                   //   swprintf(tmb2,L"dir /A: %s > \\excdir\\dir.txt",cmdb,systemdrive);

                   if(mode==0)

                   swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

           if(mode==1)

                   {

                           if(dor(cmdb)==0)

                       swprintf(tmb2,L"cmd.exe /C \"attrib /S %s\\*.*\" > %s\\excdir\\dir.txt",cmdb,temp);

               else if(dor(cmdb)==1)

                       swprintf(tmb2,L"cmd.exe /C \"attrib /S %s*.*\" > %s\\excdir\\dir.txt",cmdb,temp);

                  

                  

                  

                  

                   }

                   else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

           }

           else  if(_usrpcf==1)

           {

                  if(_fnamef==0)

                        swprintf(tmb2,L"dir /A: %s > %s\\excdir\\dir.txt",guncb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

           }   

 

         _wsystem(tmb2);

        }

        if(_kannjif==11)

        {

          wprintf(L"_kannji==11\n");

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

       

          _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dir.txt",temp);

      _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dirkj.txt",temp);

      _wsystem(tmb2);

 

        }

 

         

         

      swprintf(tmb2,L"%s\\excdir\\dirno.txt",temp);

 

         

      if((yomikomi=_wfopen(tmb,L"r"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb);

         

      if((kakikomi=_wfopen(tmb2,L"w"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb2);

         

          for(i=1;i<5000;++i)

          {

                  if(fgetws(dirb[i],1024,yomikomi)==NULL) {fileend=i-1; break;}

          else

                  {

               swprintf(line,L"%04d %s",i,dirb[i]);

                           wprintf(L"%s",line);

                       fputws(line,kakikomi);

                  }

          }

 

          fclose(yomikomi);

          fclose(kakikomi);

 

          if(fileend>300)

          {

          swprintf(tmb,L"%s  %s\\excdir\\dirno.txt",note,temp);_wsystem(tmb);

 

          }

 

      while(1)

          {

          i=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@DIR/RUN Line No.= ? ");_getws(tmb);

 

          if(tmb[0]==L'?') {dirf(cmdb);return(0);}

          if((tmb[0]==L'@') && (tmb[1]<L' ')) {dirf(cmdb);return(0);}

          if(tmb[0]==L' ') {dirf(cmdb);return(0);}

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {dirf(cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]<L'0' || tmb[0]>L'9')

          {

                       if(wcsncmp(tmb,L"@attrib /s ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if( wcscmp(tmb,L"@attrib")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB /S ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if(wcsncmp(tmb,L"@attrib ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if( wcscmp(tmb,L"@ATRRIB")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@type#",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@print#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=2;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@attrib#",8)==0) {i=_wtoi(&tmb[8]);_cmdmodef=4;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@xcopy$",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1001;goto ESTA;}

                  else if(wcsncmp(tmb,L"@xcopy#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1002;goto ESTA;}

         

          else if(wcsicmp(tmb,L"@exit")==0)     

                  {   _cmdendf=1;_exitf=1;

                  wcscpy(bkcdirb,cdirb);          

                      break;

                  }

 

 

 

 

                 

 

                  swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                  _wsystem(tmb);continue;

          }

          else

          {  i=_wtoi(tmb);bkno=i;_kannjif=0;}

 

 

ESTA:

          wprintf(L"%s",dirb[i]);

          if(i<=0) return(0);

          if(i<6) dirf(cmdb);

 

          if(i>(fileend-2)) return(0);

     

      if(wcsncmp(&dirb[i][dirtop],L"<DIR>",5)==0)    // DIR

          {

                  _dirfilef=1;

                  if(_cmdmodef==1001) {_xcopyf[0]=1,_xcopyf[1]=1;}

          if(_cmdmodef==1002) _xcopyf[2]=1;

 

                  wprintf(&dirb[i][dirtop]);

                  wcscpy(line,&dirb[i][filetop]);

                 fnamechf(line);

                  enn(line);

        //  norootf(cmdb);

                  if(_usrpcf==0)

                  {

                  if(dor(cmdb)==0)

                               swprintf(line2,L"%s\\%s",cmdb,line);

                      else if(dor(cmdb)==1)

                  swprintf(line2,L"%s%s",cmdb,line);

                  }

                  else if(_usrpcf==1)

                  {

              if(dor(guncb)==0)

                           swprintf(line2,L"%s\\%s",guncb,line);

                       else if(dor(guncb)==1)

                    swprintf(line2,L"%s%s",guncb,line);

                  }

 

 

          enn(line2);

                  wprintf(L"dirf() line2=%s\r\n",line2);

         fnamechf(line2);

         if(_kannjif==11)

                 {

                       swprintf(line3,L"dir \"%s\" > %s\\excdir\\dir.txt && type %s\\excdir\\dir.txt",line2,temp,temp);

                         //  swprintf(line3,L"dir %s > %s\\excdir\\dirkj.txt",line2,temp);

                           wprintf(L"dirf() kannji %s",line3);

                       kannji(line3);

                 }

                 else  if(_kannjif==0)

                 {

                         

                        ;// dirf(line2);

                 }     

 

 

                 if(_cmdmodef==1001) {wcscpy(xcopysb[0],line2);continue;}

                 if(_cmdmodef==1002) {wcscpy(xcopysb[1],line2);systemf(_cmdmodef,cmdb);continue;}

                 dirf(line2); cdf(cmdb);

                 

          }

          else // NO DIR

      {

                  _dirfilef=0;

                  if(_cmdmodef==1001) {_xcopyf[0]=1;_xcopyf[1]=0;}

          if(_cmdmodef==1002) _xcopyf[2]=0;

                  wprintf(L"%s",&dirb[i][dirtop]);

                  wprintf(L"%s",&dirb[i][filetop]);

ESTA2:    wcscpy(line,&dirb[i][filetop]);//fnamechf(line2);

 

       

        if(_usrpcf==0)

                {

                  if(dor(cmdb)==0)

               swprintf(line2,L"%s\\%s",cmdb,&dirb[i][filetop]);

          if(dor(cmdb)==1)

                          swprintf(line2,L"%s%s",cmdb,&dirb[i][filetop]);

                }

        if(_usrpcf==1)

                {

                  if(dor(guncb)==0)

               swprintf(line2,L"%s\\%s",guncb,&dirb[i][filetop]);

          if(dor(guncb)==1)

                          swprintf(line2,L"%s%s",guncb,&dirb[i][filetop]);

                }

 

       

        fnamechf(line2);enn(line2);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line2);

                else if(_fnamef==0)

                        wcscpy(line3,line2);

                if(line3[0]<L' ') return(0);

        enn(line3);

                if(_cmdmodef==1001) {wcscpy(xcopysb[0],line3);continue;}

        if(_cmdmodef==1002) {wcscpy(xcopysb[1],line3);}

 

 

                if(_kannjif==11) 

                  {

                          kannji(line3);

                  }

                else if(_kannjif==0)

                  {systemf(_cmdmodef,line3);}           // line2);

        }

          }//while  end

 

      return(0);

}

 

int   _dirf(wchar_t  *cmdb)

{

          int            i=0;

          int      fileend=0;

          int         bkno=7;

          wchar_t     line[1024];

          wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

          wchar_t     tmb1[1024];

      wchar_t     tmb2[1024];

         

          FILE     *yomikomi,*kakikomi;

 

 

      enn(cmdb);cdf(cmdb);

        // _wchdir(cmdb);

   //   enn(cdirb);

    

      fnamechf(cmdb);enn(cmdb);

        swprintf(tmb,L"%s\\excdir\\dir.txt",temp);

         //pcname(cdirb,usrpcb);

    if(_kannjif==0)

        {

        wprintf(L"_kannji==0\n");

           if(_usrpcf==0)

           {

                  if(_fnamef==0)

                   //   swprintf(tmb2,L"dir /A: %s > \\excdir\\dir.txt",cmdb,systemdrive);

                   swprintf(tmb2,L"cmd.exe /C \"dir /A: %s\" > %s\\excdir\\dir.txt",cmdb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

           }

           else  if(_usrpcf==1)

           {

                  if(_fnamef==0)

                        swprintf(tmb2,L"dir /A: %s > %s\\excdir\\dir.txt",guncb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

           }   

 

         _wsystem(tmb2);

        }

        if(_kannjif==11)

        {

          wprintf(L"_kannji==11\n");

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

       

          _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dir.txt",temp);

      _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dirkj.txt",temp);

      _wsystem(tmb2);

 

        }

 

         

         

      swprintf(tmb2,L"%s\\excdir\\dirno.txt",temp);

 

         

      if((yomikomi=_wfopen(tmb,L"r"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb);

         

      if((kakikomi=_wfopen(tmb2,L"w"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb2);

         

          for(i=1;i<5000;++i)

          {

                  if(fgetws(dirb[i],1024,yomikomi)==NULL) {fileend=i-1; break;}

          else

                  {

               swprintf(line,L"%04d %s",i,dirb[i]);

                           wprintf(L"%s",line);

                       fputws(line,kakikomi);

                  }

          }

 

          fclose(yomikomi);

          fclose(kakikomi);

 

          if(fileend>300)

          {

          swprintf(tmb,L"%s  %s\\excdir\\dirno.txt",note,temp);_wsystem(tmb);

 

          }

 

      while(1)

          {

          i=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@_DIR/RUN Line No.= ? ");_getws(tmb);

 

          if(tmb[0]==L'?') {dirf(cmdb);return(0);}

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {dirf(cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]<L'0' || tmb[0]>L'9')

          {

                 

                  if(wcsncmp(tmb,L"@attrib ",8)==0)   {attribf(0,&tmb[8]);continue;}

                  else if(wcscmp(tmb,L"@attrib")==0)  {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)   {attribf(0,&tmb[8]);continue;}

                  else if(wcscmp(tmb,L"@ATRRIB")==0)  {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@type ",6)==0)

                  {

                          i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;

             

 

                  }

 

                  swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                  _wsystem(tmb);continue;

          }

          else

          {  i=_wtoi(tmb);bkno=i;_kannjif=0;}

 

 

ESTA:

          wprintf(L"%s",dirb[i]);

          if(i<=0) return(0);

          if(i<6) dirf(cmdb);

 

          if(i>(fileend-2)) return(0);

     

      if(wcsncmp(&dirb[i][dirtop],L"<DIR>",5)==0)    // DIR

          {

                  wprintf(&dirb[i][dirtop]);

                  wcscpy(line,&dirb[i][filetop]);

                 fnamechf(line);

                  enn(line);

        //  norootf(cmdb);

                  if(_usrpcf==0)

                  {

                  if(dor(cmdb)==0)

                               swprintf(line2,L"%s\\%s",cmdb,line);

                      else if(dor(cmdb)==1)

                  swprintf(line2,L"%s%s",cmdb,line);

                  }

                  else if(_usrpcf==1)

                  {

              if(dor(guncb)==0)

                           swprintf(line2,L"%s\\%s",guncb,line);

                       else if(dor(guncb)==1)

                    swprintf(line2,L"%s%s",guncb,line);

                  }

 

 

          enn(line2);

                  wprintf(L"dirf() line2=%s\r\n",line2);

         fnamechf(line2);

         if(_kannjif==11)

                 {

                       swprintf(line3,L"dir \"%s\" > %s\\excdir\\dir.txt && type %s\\excdir\\dir.txt",line2,temp,temp);

                         //  swprintf(line3,L"dir %s > %s\\excdir\\dirkj.txt",line2,temp);

                           wprintf(L"dirf() kannji %s",line3);

                       kannji(line3);

                 }

                 else  if(_kannjif==0)

                 {

                         

                        ;// dirf(line2);

                 }     

                 dirf(line2); cdf(cmdb);

                 

          }

          else // NO DIR

      {

                  wprintf(L"%s",&dirb[i][dirtop]);

                  wprintf(L"%s",&dirb[i][filetop]);

ESTA2:    wcscpy(line,&dirb[i][filetop]);//fnamechf(line2);

 

       

        if(_usrpcf==0)

                {

                  if(dor(cmdb)==0)

               swprintf(line2,L"%s\\%s",cmdb,&dirb[i][filetop]);

          if(dor(cmdb)==1)

                          swprintf(line2,L"%s%s",cmdb,&dirb[i][filetop]);

                }

        if(_usrpcf==1)

                {

                  if(dor(guncb)==0)

               swprintf(line2,L"%s\\%s",guncb,&dirb[i][filetop]);

          if(dor(guncb)==1)

                          swprintf(line2,L"%s%s",guncb,&dirb[i][filetop]);

                }

 

                if(_cdirf==0)

                {

                        wcscpy(line2,&dirb[i][filetop]);

                }

           fnamechf(line2);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line2);

                else if(_fnamef==0)

                        wcscpy(line3,line2);

                if(dirb[i][filetop]<L' ') return(0);

                if(_kannjif==11) 

                  {

                          kannji(line3);

                  }

                else if(_kannjif==0)

                  {systemf(_cmdmodef,line3);}           // line2);

        }

          }//while  end

 

      return(0);

}

 

int   excf(wchar_t  *cmdb)

{

          int            i=0;

          int      fileend=0;

          int         bkno=7;

          wchar_t     line[1024];

          wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

          wchar_t     tmb1[1024];

      wchar_t     tmb2[1024];

         

          FILE     *yomikomi,*kakikomi;

 

 

      enn(cmdb);

          //cdf(cmdb);

        // _wchdir(cmdb);

   //   enn(cdirb);

    

    //  fnamechf(cmdb);

        swprintf(tmb,L"%s\\excdir\\dir.txt",temp);

         //pcname(cdirb,usrpcb);

    if(_kannjif==0)

        {

        wprintf(L"_kannji==0\n");

           if(_usrpcf==0)

           {

                  if(_fnamef==0)

                   //   swprintf(tmb2,L"dir /A: %s > \\excdir\\dir.txt",cmdb,systemdrive);

                   swprintf(tmb2,L"cmd.exe /C \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",cmdb,temp);

           }

           else  if(_usrpcf==1)

           {

                  if(_fnamef==0)

                        swprintf(tmb2,L"dir /A: %s > %s\\excdir\\dir.txt",guncb,temp);

                  else if(_fnamef==1)

              swprintf(tmb2,L"dir /A: \"%s\" > %s\\excdir\\dir.txt",guncb,temp);

           }   

 

         _wsystem(tmb2);

        }

        if(_kannjif==11)

        {

          wprintf(L"_kannji==11\n");

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dir.txt",temp,temp);

          if(_usrpcf==0)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

          else  if(_usrpcf==1)

                  swprintf(tmb2,L"%s\\excdir\\batcmd\\$cmdbat.cmd > %s\\excdir\\dirkj.txt",temp,temp);

       

          _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dir.txt",temp);

      _wsystem(tmb2);

       swprintf(tmb2,L"type %s\\excdir\\dirkj.txt",temp);

      _wsystem(tmb2);

 

        }

 

         

         

      swprintf(tmb2,L"%s\\excdir\\dirno.txt",temp);

 

         

      if((yomikomi=_wfopen(tmb,L"r"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb);

         

      if((kakikomi=_wfopen(tmb2,L"w"))==NULL)

            wprintf(L"Err! diff() _wfopen() No file! %s \n",tmb2);

         

          for(i=1;i<5000;++i)

          {

                  if(fgetws(dirb[i],1024,yomikomi)==NULL) {fileend=i-1; break;}

          else

                  {

               swprintf(line,L"%04d %s",i,dirb[i]);

                           wprintf(L"%s",line);

                       fputws(line,kakikomi);

                  }

          }

 

          fclose(yomikomi);

          fclose(kakikomi);

 

          if(fileend>300)

          {

          swprintf(tmb,L"%s  %s\\excdir\\dirno.txt",note,temp);_wsystem(tmb);

 

          }

 

      while(1)

          {

          i=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@DIR/RUN Line No.= ? ");_getws(tmb);

 

          if(tmb[0]==L'?') {dirf(cmdb);return(0);}

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {dirf(cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]<L'0' || tmb[0]>L'9')

          {

                 

                  if(wcsncmp(tmb,L"@attrib ",8)==0)   {attribf(0,&tmb[8]);continue;}

                  else if(wcscmp(tmb,L"@attrib")==0)  {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)   {attribf(0,&tmb[8]);continue;}

                  else if(wcscmp(tmb,L"@ATRRIB")==0)  {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@type ",6)==0)

                  {

                          i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;

             

 

                  }

          else if(wcsicmp(tmb,L"@exit")==0)     

                  {   _cmdendf=1;_exitf=1;

                  wcscpy(bkcdirb,cdirb);          

                      break;

                  }

                  swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                  _wsystem(tmb);continue;

          }

          else

          {  i=_wtoi(tmb);bkno=i;_kannjif=0;}

 

 

ESTA:

          wprintf(L"%s",dirb[i]);

          if(i<=0) return(0);

          if(i<6) dirf(cmdb);

 

          if(i>(fileend-2)) return(0);

     

      if(wcsncmp(&dirb[i][dirtop],L"<DIR>",5)==0)    // DIR

          {

                  wprintf(&dirb[i][dirtop]);

                  wcscpy(line,&dirb[i][filetop]);

                 fnamechf(line);

                  enn(line);

        //  norootf(cmdb);

                  if(_usrpcf==0)

                  {

                  if(dor(cmdb)==0)

                               swprintf(line2,L"%s\\%s",cmdb,line);

                      else if(dor(cmdb)==1)

                  swprintf(line2,L"%s%s",cmdb,line);

                  }

                  else if(_usrpcf==1)

                  {

              if(dor(guncb)==0)

                           swprintf(line2,L"%s\\%s",guncb,line);

                       else if(dor(guncb)==1)

                    swprintf(line2,L"%s%s",guncb,line);

                  }

 

 

          enn(line2);

                  wprintf(L"dirf() line2=%s\r\n",line2);

         fnamechf(line2);

         if(_kannjif==11)

                 {

                       swprintf(line3,L"dir \"%s\" > %s\\excdir\\dir.txt && type %s\\excdir\\dir.txt",line2,temp,temp);

                         //  swprintf(line3,L"dir %s > %s\\excdir\\dirkj.txt",line2,temp);

                           wprintf(L"dirf() kannji %s",line3);

                       kannji(line3);

                 }

                 else  if(_kannjif==0)

                 {

                         

                        ;// dirf(line2);

                 }     

                 dirf(line2); cdf(cmdb);

                 

          }

          else // NO DIR

      {

                  wprintf(L"%s",&dirb[i][dirtop]);

                  wprintf(L"%s",&dirb[i][filetop]);

ESTA2:    wcscpy(line,&dirb[i][filetop]);//fnamechf(line2);

 

        

        if(_usrpcf==0)

                {

                  if(dor(cmdb)==0)

               swprintf(line2,L"%s\\%s",cmdb,&dirb[i][filetop]);

          if(dor(cmdb)==1)

                          swprintf(line2,L"%s%s",cmdb,&dirb[i][filetop]);

                }

        if(_usrpcf==1)

                {

                  if(dor(guncb)==0)

               swprintf(line2,L"%s\\%s",guncb,&dirb[i][filetop]);

          if(dor(guncb)==1)

                          swprintf(line2,L"%s%s",guncb,&dirb[i][filetop]);

                }

 

                if(_cdirf==0)

                {

                        wcscpy(line2,&dirb[i][filetop]);

                }

           fnamechf(line2);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line2);

                else if(_fnamef==0)

                        wcscpy(line3,line2);

                if(dirb[i][filetop]<L' ') return(0);

                if(_kannjif==11) 

                  {

                          kannji(line3);

                  }

                else if(_kannjif==0)

                  {systemf(_cmdmodef,line3);}           // line2);

        }

          }//while  end

 

      return(0);

}

 

 

 

int   cmdf(wchar_t  *cmdb)

{

   

     int    argc=0;

 

//      char    sargv[4][100];

 

          _xcopyf[0]=0;_xcopyf[1]=0;_xcopyf[2]=0;

      while(1)

          {

                  _doserrno=0;

                  _cmdmodef=0;

                  _treef_endf=0;

                  _xcopyf[0]=0;_xcopyf[1]=0;_xcopyf[2]=0;

                  _cmdendf=0;

          _findsubno=1;

 

 

 

          if(_exitf==1)

                  {

                          wcscpy(cdirb,bkcdirb);_wchdir(cdirb);_exitf=0;

                  }

                  _wchdir(cdirb);

                  pcname(cmdb,usrpcb);

                  wprintf(L"\ncdir=%s home=%s err=%d %d\n",cdirb,home,errno,_doserrno);errno=0;_doserrno=0;

          if(_usrpcf==0)

                  {

                          wprintf(L"cunc=%s\n",uncb);

                      wprintf(L"%s%ddir@ ",usrpcb,_usrpcf);

                  }

          else if(_usrpcf==1)

                  {

                          wprintf(L"GUNC=%s\n",guncb);

              wprintf(L"%s%dunc@ ",usrpcb,_usrpcf);

                  }      

                  if(cmdhistno<0)  cmdhistno=0;

                  if(cmdhistno>49) cmdhistno=0;

                  _getws(cmdb);wcscpy(cmdhist[cmdhistno++],cmdb);

                  if(wcscmp(cmdb,L"@cmdhist")==0)

                  {

                          if(cmdhistf(cmdb)==1) continue;

                  }

           

 

                       

           

                  if(cmdb[0]==L'!' || cmdb[0]==L'/' || cmdb[0]==L'_') { _wsystem(&cmdb[1]);continue;}

 

           

 

            if((cmdb[0]==L' ') && (cmdb[1]<L' '))  {exccmd(cmdb);continue;}

            if(cmdb[0]<L' ') continue;

                        if(nospacef(cmdb)==1) continue;

            if((cmdb[1]==L':') && (cmdb[2]<L' ')) {chdrive(cmdb);continue;} 

            if(cmdb[0]==L'&') {holderf(cmdb);continue;}

                        if(cmdb[0]==L'$') {batrunf(cmdb);continue;}

            if(cmdb[0]!=L'@')

                        {

                                if(_wsystem(cmdb)==(-1)) errnof();

                                continue;}

                       

                         if( wcscmp(cmdb,L"@@")==0)          {saigennf(2,cmdb);continue;}

            else if(wcsncmp(cmdb,L"@@ ",3)==0)       {saigennf(0,&cmdb[3]);continue;}

            else if( wcscmp(cmdb,L"@@@")==0)         {saigennf(3,cmdb);}

                        else if( wcscmp(cmdb,L"@@@0")==0)        {saigennf(4,cmdb);continue;}

                        else if( wcscmp(cmdb,L"@@@1")==0)        {saigennf(5,cmdb);continue;}

                        else if( wcscmp(cmdb,L"@@@2")==0)        {saigennf(6,cmdb);continue;}

                        else if( wcscmp(cmdb,L"@@@3")==0)        {saigennf(7,cmdb);continue;}

                        else if(wcsncmp(cmdb,L"@@@ ",4)==0)      {saigennf(1,cmdb);}

                        else if(wcsncmp(cmdb,L"@_dir ",6)==0)    {_dirf(&cmdb[6]);continue;}

                        else if(wcsncmp(cmdb,L"@_DIR ",6)==0)    {_dirf(&cmdb[6]);continue;}

                        else if(wcsncmp(cmdb,L"@tree /f ",9)==0) {treef(1,&cmdb[9]);continue;}

                        else if(wcsncmp(cmdb,L"@TREE /F ",9)==0) {treef(1,&cmdb[9]);continue;}

                    else if(wcsncmp(cmdb,L"@tree ",6)==0)    {treef(1,&cmdb[6]);continue;}

                        else if(wcsncmp(cmdb,L"@TREE ",6)==0)    {treef(1,&cmdb[6]);continue;}

                        else if(wcsncmp(cmdb,L"@tree-f ",8)==0)  {treef(0,&cmdb[8]);continue;}

                        else if(wcsncmp(cmdb,L"@TREE-F ",8)==0)  {treef(0,&cmdb[8]);continue;}

                        else if(wcsncmp(cmdb,L"@attrib /s ",11)==0) {attribf(1,&cmdb[11]);continue;}

                        else if(wcsncmp(cmdb,L"@ATTRIB /S ",11)==0) {attribf(1,&cmdb[11]);continue;}

                        else if(wcsncmp(cmdb,L"@attrib ",8)==0)  {attribf(0,&cmdb[8]);continue;}

                        else if(wcsncmp(cmdb,L"@ATTRIB ",8)==0)  {attribf(0,&cmdb[8]);continue;}

                    else if( wcscmp(cmdb,L"@exit")==0) _exit(0);else if(wcscmp(cmdb,L"@EXIT")==0) _exit(0);

                        else if( wcscmp(cmdb,L"@ini")==0)        {wcscpy(cmdb,home);inif();continue;}

                        else if( wcscmp(cmdb,L"@INI")==0)        {wcscpy(cmdb,home);inif();continue;}

                        else if( wcscmp(cmdb,L"@home")==0)       {wcscpy(cmdb,home);if(cdf(cmdb)<=1) continue;}

                        else if( wcscmp(cmdb,L"@HOME")==0)       {wcscpy(cmdb,home);if(cdf(cmdb)<=1) continue;}

                        else if( wcscmp(cmdb,L"@os")==0)         {osf();continue;}

            else if( wcscmp(cmdb,L"@OS")==0)         {osf();continue;}

                        else if( wcscmp(cmdb,L"@pwd")==0)        {pwdf();continue;}

                        else if( wcscmp(cmdb,L"@PWD")==0)         {pwdf();continue;}

                        else if(wcsncmp(cmdb,L"@chdrive ",9)==0)  {chdrive(&cmdb[9]);continue;}

                        else if(wcsncmp(cmdb,L"@CHDRIVE ",9)==0)  {chdrive(&cmdb[9]);continue;}

                        else if(wcsncmp(cmdb,L"@cd ",4)==0)     {if(cdf(&cmdb[4])<=1) continue;}

            else if(wcsncmp(cmdb,L"@CD ",4)==0)     {if(cdf(&cmdb[4])<=1) continue;}

                        else if(wcsncmp(cmdb,L"@chdir ",7)==0)  {if(cdf(&cmdb[7])<=1) continue;}

                        else if(wcsncmp(cmdb,L"@cdtest ",8)==0)  {if(cdtest(&cmdb[8])<=1) continue;}

                        else if(wcsncmp(cmdb,L"@CHDIR ",7)==0)  {if(cdf(&cmdb[7])<=1) continue;}

                        else if(wcsncmp(cmdb,L"@set ",5)==0)    {if(setf(&cmdb[5])<=1) continue;}

                        else if(wcsncmp(cmdb,L"@SET ",5)==0)    {if(setf(&cmdb[5])<=1 ) continue;}

            else if( wcscmp(cmdb,L"@cd")==0)        {wprintf(L"%s",cdirb); continue;}

            else if( wcscmp(cmdb,L"@unc")==0)       {wprintf(L"%s", uncb); continue;}

            else if( wcscmp(cmdb,L"@CD")==0)        {wprintf(L"%s",cdirb); continue;}

            else if( wcscmp(cmdb,L"@UNC")==0)       {wprintf(L"%s", uncb); continue;}

            else if( wcscmp(cmdb,L"@homeb")==0)     {wprintf(L"%s",home); continue;}

            else if( wcscmp(cmdb,L"@HOMEB")==0)     {wprintf(L"%s", home); continue;}

            else if( wcscmp(cmdb,L"@pcname")==0)    {wprintf(L"%s",logonserver); continue;}

            else if( wcscmp(cmdb,L"@usrpc")==0)     {wprintf(L"%s",usrpcb); continue;}

            else if( wcscmp(cmdb,L"@temp")==0)      {wprintf(L"%s",temp); continue;}

            else if( wcscmp(cmdb,L"@note")==0)      {_wsystem(note); continue;}

                        else if( wcscmp(cmdb,L"@NOTE")==0)      {_wsystem(note); continue;}

                        else if( wcscmp(cmdb,L"@word")==0)      {_wsystem(words); continue;}

                        else if( wcscmp(cmdb,L"@WORD")==0)      {_wsystem(words); continue;}

            else if( wcscmp(cmdb,L"@excel")==0)     {_wsystem(excels); continue;}

                        else if( wcscmp(cmdb,L"@EXCEL")==0)     {_wsystem(excels); continue;}

            else if( wcscmp(cmdb,L"@outlook")==0)   {_wsystem(outlooks); continue;}

                        else if( wcscmp(cmdb,L"@OUTLOOK")==0)   {_wsystem(outlooks); continue;}

            else if(wcsncmp(cmdb,L"@note ",6)==0)   {notef(&cmdb[6]); continue;}

            else if(wcsncmp(cmdb,L"@NOTE ",6)==0)   {notef(&cmdb[6]); continue;}

                        else if(wcsncmp(cmdb,L"@word ",6)==0)   {wordf(&cmdb[6]); continue;}

                        else if(wcsncmp(cmdb,L"@WORD ",6)==0)   {wordf(&cmdb[6]); continue;}

            else if(wcsncmp(cmdb,L"@excel ",7)==0)  {excelf(&cmdb[7]); continue;}

                        else if(wcsncmp(cmdb,L"@EXCEL ",7)==0)  {excelf(&cmdb[7]); continue;}

 

 

            else if( wcscmp(cmdb,L"@cdirb")==0)   {wprintf(L"%s",cdirb); continue;}

            else if( wcscmp(cmdb,L"@dirunc")==0)   {dirunc(cdirb,uncb);wprintf(L"dir=%s unc=%s",cdirb,uncb); continue;}

            else if( wcscmp(cmdb,L"@uncdir")==0)   {uncdir(uncb,cdirb);wprintf(L"dir=%s unc=%s",cdirb,uncb); continue;}

            else if( wcscmp(cmdb,L"@usrpc")==0)   {wprintf(L"%s",usrpcb); continue;}

            else if( wcscmp(cmdb,L"@usrpc")==0)   {wprintf(L"%s",usrpcb); continue;}

            else if( wcscmp(cmdb,L"@usrpc")==0)   {wprintf(L"%s",usrpcb); continue;}

            else if( wcscmp(cmdb,L"@usrpc")==0)   {wprintf(L"%s",usrpcb); continue;}

            else if( wcscmp(cmdb,L"@pc")==0) 

                        {pcname(uncb,usrpcb);wprintf(L"usrpc=%s _usrpcf=%d",usrpcb,_usrpcf); continue;}

 

 

            else if(wcsncmp(cmdb,L"@uni ",5)==0)  {_wsystem(&cmdb[5]); continue;}

            else if( wcscmp(cmdb,L"@uni")==0)  {test(); continue;}

            else if( wcscmp(cmdb,L"@ie")==0)  {_wsystem(ies); continue;}

                        else if( wcscmp(cmdb,L"@IE")==0)  {_wsystem(ies); continue;}

                        else if( wcscmp(cmdb,L"@ex")==0)  {_wsystem(ex); continue;}

                        else if( wcscmp(cmdb,L"@EX")==0)  {_wsystem(ex); continue;}

            else if( wcscmp(cmdb,L"@pushd")==0) {wcscpy(pushdb,cdirb); continue;}

            else if( wcscmp(cmdb,L"@PUSHD")==0) {wcscpy(pushdb,cdirb); continue;}

            else if(wcsncmp(cmdb,L"@pushd ",7)==0)      {wcscpy(pushdb,&cmdb[7]); continue;}

            else if(wcsncmp(cmdb,L"@PUSHD ",7)==0)      {wcscpy(pushdb,&cmdb[7]); continue;}

                        else if( wcscmp(cmdb,L"@PUSHD")==0)     {wcscpy(pushdb,cdirb); continue;}

            else if( wcscmp(cmdb,L"@popd")==0)  {cdf(pushdb); continue;}

            else if( wcscmp(cmdb,L"@POPD")==0)  {cdf(pushdb); continue;}

 

 

            else if(wcsncmp(cmdb,L"@ie ",4)==0)  {ief(&cmdb[4]); continue;}

            else if(wcsncmp(cmdb,L"@ex ",4)==0)  {exf(&cmdb[4]); continue;}

            else if(wcsncmp(cmdb,L"@IE ",4)==0)  {ief(&cmdb[4]); continue;}

            else if(wcsncmp(cmdb,L"@EX ",4)==0)  {exf(&cmdb[4]); continue;}

            else if(wcsncmp(cmdb,L"@kannji ",8)==0)  {kannji(&cmdb[8]); continue;}

            else if( wcscmp(cmdb,L"@key")==0)  {keyf(); continue;}

            else if(wcsncmp(cmdb,L"@stat ",6)==0)  {statf(&cmdb[6]); continue;}

            else if(wcsncmp(cmdb,L"@exc ",5)==0)  {excf(&cmdb[5]); continue;}

                        else if(wcsncmp(cmdb,L"@EXC ",5)==0)  {excf(&cmdb[5]); continue;}

            else if( wcscmp(cmdb,L"@cdhist")==0)  {cdhistf(); continue;}

                        else if( wcscmp(cmdb,L"@atime")==0)  {atimef();continue;}                    

            else if(wcsncmp(cmdb,L"@find ",6)==0)  {findf(&cmdb[6]);continue;}

            else if(wcsncmp(cmdb,L"@fin ",5)==0)   {finddirf(0,&cmdb[5]);continue;}

            else if(wcsncmp(cmdb,L"@fin ",5)==0)   {finddirf(0,&cmdb[5]);continue;}

            else if(wcsncmp(cmdb,L"@FIN ",5)==0)   {finddirf(0,&cmdb[5]);continue;}

            else if(wcsncmp(cmdb,L"@fina ",6)==0)  {finddirf(1,&cmdb[6]);continue;}

            else if(wcsncmp(cmdb,L"@FINA ",6)==0)  {finddirf(1,&cmdb[6]);continue;}

            else if(wcsncmp(cmdb,L"@finw ",6)==0)  {finddirf(0,&cmdb[6]);continue;}

            else if(wcsncmp(cmdb,L"@FINW ",6)==0)  {finddirf(0,&cmdb[6]);continue;}

            else if(wcsncmp(cmdb,L"@finc ",6)==0)  {finddirf(2,&cmdb[6]);continue;}

            else if(wcsncmp(cmdb,L"@FINC ",6)==0)  {finddirf(2,&cmdb[6]);continue;}

                        else if( wcscmp(cmdb,L"@ctime")==0)  {ctimef();continue;}

                        else if( wcscmp(cmdb,L"@mail")==0) {printf("@mail");continue;}

            else if( wcscmp(cmdb,L"@mtest")==0) {printf("@mail");continue;}

        //              else if(wcsncmp(cmdb,L"@FINC ",6)==0)  {finddirf(2,&cmdb[6]);continue;}                

                       

                       

//                      else if( wcscmp(cmdb,L"@tcp")==0) {tcpmain();continue;}                

                       

                       

                       

                       

                        else if( wcscmp(cmdb,L"@exit")==0)  { exit(0);}

                        else if( wcscmp(cmdb,L"@_exit")==0)  { _exit(0);}

                        else if( wcscmp(cmdb,L"@_cexit")==0)  { _cexit();continue;}

                        else if( wcscmp(cmdb,L"@_c_exit")==0)  { _c_exit();continue;}

                        else if( wcscmp(cmdb,L"@EXIT")==0)  { exit(0);}

            else if( wcscmp(cmdb,L"@_EXIT")==0)  { _exit(0);}

                        else if( wcscmp(cmdb,L"@_CEXIT")==0)  { _cexit();continue;}

                        else if( wcscmp(cmdb,L"@_C_EXIT")==0)  { _c_exit();continue;}

        //              else if(wcsncmp(cmdb,L"@modedir ",9)==0) {modedirf(0,&cmdb[9]);continue;}

                        else if( wcscmp(cmdb,L"@@?")==0) {printf("@?");continue;}

            else if( wcscmp(cmdb,L"@end")==0) {if(endf()==1) return(1); else continue;}

                        else if( wcscmp(cmdb,L"@END")==0) {if(endf()==1) return(1); else continue;}

                        else if( wcscmp(cmdb,L"@help")==0) {helpf(cmdb);continue;}

                        else if(wcsncmp(cmdb,L"@kennsaku ",10)==0) {kennsaku(&cmdb[10]);continue;}

 

       

                    if(cmdf2(cmdb)==1) continue ;

 

            if(cmdf3(cmdb)==1) continue ;

 

            if(cmdf4(cmdb)==1) continue ;

               

                        if(cmdf5(cmdb)==1) continue ;

 

                        if(extcmdf(cmdb)==1) continue;

 

                        if(_wsystem(cmdb)==(-1)) errnof();

          }

 

 

 

      wprintf(L"EXCCMD END!\n");

      return 0;

}

 

int     endf(void)

{

      wchar_t     cmd[1024];

 

          wprintf(L"\nEXC.EXE  EXIT/END (yes/n) ? ");_getws(cmd);

      if(wcscmp(cmd,L"yes")==0 || wcscmp(cmd,L"YES")==0)

            return(1);

          else return(0);

          return(0);

}

 

int   systemf(int   _cmdmodef,wchar_t  *cmdb)

{

        wchar_t   line[1024];

//      wchar_t line2[2048];

  //  wchar_t  nul=NULL;

        //int   cmd[1024];

 

 

   //   swprintf(line,L"%s",cmdb);

//      enn(line);

//      wprintf(line);

//      if(swprintf(line2,L"%s%c",line,nul)==0) wprintf(L"swprintf err!") ;

//      wprintf(line2);

   // sprintf(cmd,"%s",cmdb);printf(cmd);

     wcscpy(line,cmdb);

        if(_cmdmodef==0)

          wcscpy(line,cmdb);

        else if(_cmdmodef==1)

          swprintf(line,L"type %s",cmdb);

    else if(_cmdmodef==2)

          swprintf(line,L"print %s",cmdb);

    else if(_cmdmodef==4)

          swprintf(line,L"attrib %s",cmdb);

    else if(_cmdmodef==8)

        {

          swprintf(line,L"%s %s",note,cmdb);

        }

        else if(_cmdmodef==9)

        {

          swprintf(line,L"%s %s",note,cmdb);

                  if(_wspawnlp(_P_NOWAIT,note,note,cmdb,L'\0')== (-1))

                  {

                          wprintf(L"\n _wspawn() err! cmdb=%s errono.=%d",cmdb,errno);

                  }

                  _cmdmodef=0;return(0);

        }

        else if(_cmdmodef==10)

        {

          swprintf(line,L"%s %s",ex,cmdb);

                  if(_wspawnlp(_P_NOWAIT,ex,ex,cmdb,L'\0')== (-1))

                  {

                          wprintf(L"\n _wspawn() err! cmdb=%s errono.=%d",cmdb,errno);

                  }

                   _cmdmodef=0;return(0);

        }

        else if(_cmdmodef==16)

        {

          swprintf(line,L"%s %s",ie,cmdb);

                  if(_wspawnlp(_P_NOWAIT,ie,ies,cmdb,L'\0')== (-1))

                  {

                          wprintf(L"\n _wspawn() err! cmdb=%s errono.=%d",cmdb,errno);

                  }

                   _cmdmodef=0;return(0);

        }

        else if(_cmdmodef==20)

        {

          swprintf(line,L"%s %s",ie,cmdb);

                  if(_wspawnlp(_P_NOWAIT,cmdb,cmdb,L'\0')== (-1))

                  {

                          wprintf(L"\n _wspawn() err! cmdb=%s errono.=%d",cmdb,errno);

                  }

                   _cmdmodef=0;return(0);

        }

 

    else if((_cmdmodef==1002) && (_xcopyf[0]==1) && (_xcopyf[1]==0) && (_xcopyf[2]==1))

          swprintf(line,L"xcopy  %s %s",&xcopysb[0][0],&xcopysb[1][0]);

    else if((_cmdmodef==1002) && (_xcopyf[0]==1) && (_xcopyf[1]==1) && (_xcopyf[2]==1))

          swprintf(line,L"xcopy /s %s %s",&xcopysb[0][0],&xcopysb[1][0]);

 

        enn(line);

        if(debug==1) wprintf(L"systemf() line=%s\n",line);

    if(_wsystem(line)==(-1)) {wprintf(L"system err! ");_cmdmodef=0;return(1);}

             _cmdmodef=0;

       

 

         _cmdmodef=0;return(0);

}

 

int   modesystemf(int  mode,wchar_t  *cmdb)

{

        wchar_t   line[1024];

 

        if(mode==0)

          wcscpy(line,cmdb);

        else if(mode==1)

          swprintf(line,L"type %s",cmdb);

 

    if(_wsystem(line)==(-1)) {wprintf(L"system err! ");_cmdmodef=0;return(1);}

             _cmdmodef=0;

       

 

        return(0);

}

 

int  excsystemf(wchar_t *cmdb)

{

      wchar_t   line[1024];

 

      fnamechf(cmdb);

 

          if(_fnamef==1)

                swprintf(line,L"\"%s\"",cmdb);

          else wcscpy(line,cmdb);

                if(_kannjif==11) 

                    {

                          kannji(line);_kannjif=0;

                    }

                else if(_kannjif==0)

             if(_wsystem(line)==(-1)) {wprintf(L"system err! ");return(1);}

        return(0);

}

int     test(void)

{

 

       wchar_t    unic[2024];

 

 

       wprintf(L"unicode > ");_getws(unic);

           wprintf(unic);

 

           _wsystem(unic);

 

 

 

     return(0);

}

 

int   exccmd(wchar_t   *cmdb)

{

     wchar_t    tm[1024];

 

 

         swprintf(tm,L"notepad.exe \"%s\\excdir\\batcmd\\$exccmd.cmd\"",temp);

         _wsystem(tm);

 

         swprintf(tm,L"\"%s\\excdir\\batcmd\\$exccmd.cmd\"",temp);_wsystem(tm);

         swprintf(tm,L"xcopy \"%s\\excdir\\null.txt\" \"%s\\excdir\\batcmd\\$exccmd.cmd\"",temp,temp);

         _wsystem(tm);

     return(0);

}

 

int   ief(wchar_t   *cmdb)

{

      wchar_t  tm[1024];

 

          if((wcsncmp,cmdb,L"www.",4)==0)

          {

                  swprintf(tm,L"\"%s\" http://%s",ie,cmdb); wprintf(L"\n cmdb=%s",tm);

                  _wsystem(tm);

          }

 

      swprintf(tm,L"\"%s\" %s",ie,cmdb);wprintf(L"\n cmdb=%s",tm);

                  _wsystem(tm);

 

//                       \Program Files\Internet Explorer\iexplore.exe" -nohom

     return(0);

}

 

int   exf(wchar_t   *cmdb)

{

      wchar_t  tm[1024];

 

      swprintf(tm,L"%s %s",ex,cmdb);

                  _wsystem(tm);

 

//                       \Program Files\Internet Explorer\iexplore.exe" -nohom

     return(0);

}

 

 

int    kannji(wchar_t *cmdb)

{

       wchar_t   tmpb[1024];

           wchar_t   line[1024];

 

           FILE   *kakikomi;

 

           swprintf(tmpb,L"%s\\excdir\\batcmd\\$cmdbat.cmd",temp);

       if((kakikomi=_wfopen(tmpb,L"w"))==NULL)

            wprintf(L"Err! kannji() _wfopen() No file! %s \n",tmpb);

        else

                  {

              if(_cmdmodef==0)

                                swprintf(line,L"%s",cmdb);

              else if(_cmdmodef==1)

                                swprintf(line,L"type %s",cmdb);

 

                       fputws(line,kakikomi);

                  }

       

          fclose(kakikomi);

 

          _wsystem(tmpb);

    //  swprintf(tmpb,L"xcopy \"%s\\excdir\\null.txt\" \"%s\\excdir\\exccmd.bat\"",temp,temp);

        //  _wsystem(tmpb);

 

 

 

       return(0);

}

 

int   fnamechf(wchar_t *cmdb)

{

        int  i;

        int  f=0;

 

        wchar_t tmpb[1024];

 

       _kannjif=0;

           _fnamef=0;

 

       for(i=0;i<1020;++i)

           {

                        if(cmdb[i]<L' ')  break;

           else if(cmdb[i]==L' ')  ++f;

           else if(cmdb[i]==L'&')  ++f;

           else if(cmdb[i]==L'(')  ++f;

                   else if(cmdb[i]==L')')  ++f;

                   else if(cmdb[i]==L'[')  ++f;

                   else if(cmdb[i]==L']')  ++f;

                   else if(cmdb[i]==L'{')  ++f;

                   else if(cmdb[i]==L'}')  ++f;

                   else if(cmdb[i]==L'^')  ++f;

                   else if(cmdb[i]==L'=')  ++f;

                   else if(cmdb[i]==L';')  ++f;

                   else if(cmdb[i]==L'!')  ++f;

           else if(cmdb[i]==L'\'') ++f;

                   else if(cmdb[i]==L'+')  ++f;

                   else if(cmdb[i]==L',')  ++f;

                   else if(cmdb[i]==L'`')  ++f;

                   else if(cmdb[i]==L'~')  ++f;

                   else if(cmdb[i]>L'~')   {++f;_kannjif=11;}

           }

      if(f>0)

          { swprintf(tmpb,L"%s",cmdb);wcscpy(cmdb,tmpb);_fnamef=1;return(1);}

          else

          {

                  _kannjif=0;

                  _fnamef=0;

          }

          return(0);

}

 

int    keyf(void)

{

     int   i;

     wchar_t   ch0,ch1;

 

         for(i=0;i<60000;++i)

         {

                 wprintf(L"\nEnd=@ >");

         ch0=_getch();ch1=_getch();

                 wprintf(L"\n %c-%c=%d-%d",ch0,ch1,ch0,ch1);

         if(ch0=='@') break;

 

 

         }

 

 

 

     return(0);

}

 

int       notef(wchar_t *cmdb)

{    

 

         wchar_t     tmpb[1024];

 

                 swprintf(tmpb,L"%s %s",note,cmdb);

 

         _wsystem(tmpb);

        return(0);

}

 

int       wordf(wchar_t *cmdb)

{    

 

         wchar_t     tmpb[1024];

 

                 swprintf(tmpb,L"%s %s",words,cmdb);

                 wprintf(L"\ncmdb=%s",tmpb);

 

         _wsystem(tmpb);

        return(0);

}

 

int      outlookf(wchar_t *cmdb)

{    

 

         wchar_t     tmpb[1024];

 

                 swprintf(tmpb,L"%s",outlooks);

                 wprintf(L"\ncmdb=%s",tmpb);

 

         _wsystem(tmpb);

        return(0);

}

 

int       excelf(wchar_t *cmdb)

{    

 

         wchar_t     tmpb[1024];

 

                 swprintf(tmpb,L"%s %s",excels,cmdb);

                 wprintf(L"\ncmdb=%s",tmpb);

 

         _wsystem(tmpb);

        return(0);

}

 

 

int   statf(wchar_t *cmdb)

{

     struct   _stat  buf;

 

         int   i;

 

 

         i=_wstat(cmdb,&buf);

 

     if(i!=0) perror("Err! No File\n");

         else

         {

                 wprintf(L"\n fname=%s",cmdb);

                 wprintf(L"\n File Size=%ld",   buf.st_size);

                 wprintf(L"\n Drive=%c:",        buf.st_dev+L'A');

                 printf("\n 作成時刻=%s",     ctime(&buf.st_ctime));

         printf(" 更新時刻=%s",     ctime(&buf.st_mtime));

                 printf(" 実行時刻=%s",     ctime(&buf.st_atime));

         }

 

     return(0);

}

 

int   atimef(void)

{

     struct  tm   *newtime;

         time_t  aclock;

 

 

         time(&aclock);newtime=localtime(&aclock);

         wprintf(L" %s\n",_wasctime(newtime));

 

 

 

 

 

     return(0);

}

 

int   cmdf2(wchar_t  *cmdb)

{

     double   x,y;

         int i;

     char     s[1024];

         char     cmdbc[1024];

 

 

     for(i=0;i<1000;i++)

         {

 

                 if(cmdb[i]<L' '){cmdbc[i]='\0';break;}

                 else cmdbc[i]=char(cmdb[i]);

         }

         

         for(i=0;i<1000;i++)

         {

                 if(cmdbc[i]<' ') {cmdbc[i]='\0';break;}

                 else if(cmdbc[i]==')') {cmdbc[i]='\0';break;}

                 else if(cmdbc[i]=='=') {cmdbc[i]='\0';break;}

                 else if(cmdbc[i]==',') {cmdbc[i]='\0';strcpy(s,&cmdbc[i+1]);y=atof(s);}

     }

    

          if(wcsncmp(cmdb, L"@asin(",6)==0) { x=atof(&cmdbc[6]);wprintf( L"asin(%f)=%20.18f",x, asinl(x));return(1);}

     else if(wcsncmp(cmdb, L"@acos(",6)==0) { x=atof(&cmdbc[6]);wprintf( L"acos(%f)=%20.18f",x, acosl(x));return(1);}

         else if(wcsncmp(cmdb, L"@atan(",6)==0) { x=atof(&cmdbc[6]);wprintf( L"atan(%f)=%20.18f",x, atanl(x));return(1);}

     else if(wcsncmp(cmdb,  L"@sin(",5)==0) { x=atof(&cmdbc[5]);wprintf(  L"sin(%f)=%20.18f",x,  sinl(x));return(1);}

     else if(wcsncmp(cmdb,  L"@cos(",5)==0) { x=atof(&cmdbc[5]);wprintf(  L"cos(%f)=%20.18f",x,  cosl(x));return(1);}

         else if(wcsncmp(cmdb,  L"@tan(",5)==0) { x=atof(&cmdbc[5]);wprintf(  L"tan(%f)=%20.18f",x,  tanl(x));return(1);}

     else if(wcsncmp(cmdb, L"@sinh(",6)==0) { x=atof(&cmdbc[6]);wprintf( L"sinh(%f)=%20.18f",x, sinhl(x));return(1);}

     else if(wcsncmp(cmdb, L"@cosh(",6)==0) { x=atof(&cmdbc[6]);wprintf( L"cosh(%f)=%20.18f",x, coshl(x));return(1);}

         else if(wcsncmp(cmdb, L"@tanh(",6)==0) { x=atof(&cmdbc[6]);wprintf( L"tanh(%f)=%20.18f",x, tanhl(x));return(1);}

     else if(wcsncmp(cmdb, L"@sqrt(",6)==0) { x=atof(&cmdbc[6]);wprintf( L"sqrt(%f)=%20.18f",x, sqrtl(x));return(1);}

     else if(wcsncmp(cmdb,  L"@exp(",5)==0) { x=atof(&cmdbc[5]);wprintf(  L"exp(%f)=%20.18f",x,  expl(x));return(1);}

     else if(wcsncmp(cmdb,  L"@log(",5)==0) { x=atof(&cmdbc[5]);wprintf(  L"log(%f)=%20.18f",x,  logl(x));return(1);}

     else if(wcsncmp(cmdb,L"@log10(",7)==0) { x=atof(&cmdbc[7]);wprintf(L"log10(%f)=%20.18f",x,log10l(x));return(1);}

     else if(wcsncmp(cmdb,  L"@exp(",5)==0) { x=atof(&cmdbc[5]);wprintf(  L"exp(%f)=%20.18f",x,  expl(x));return(1);}

     else if(wcsncmp(cmdb,  L"@exp(",5)==0) { x=atof(&cmdbc[5]);wprintf(  L"exp(%f)=%20.18f",x,  expl(x));return(1);}

    

         else if(wcsncmp(cmdb,L"@atan2(",7)==0) { x=atof(&cmdbc[7]);wprintf( L"atan2(%f,%f)=%20.18f",y,x,atan2l(y,x));return(1);}

     else if(wcsncmp(cmdb,  L"@pow(",5)==0) { x=atof(&cmdbc[5]);wprintf(   L"pow(%f,%f)=%20.18f",x,y,powl(x,y));return(1);}

               

 

 

      return(0);

}

 

int      cmdf3(wchar_t  *cmdb)

{

 

             if(wcsncmp(cmdb,L"@http",5)==0)       {ief(&cmdb[1]); return(1);}

            else if(wcsncmp(cmdb,L"@HTTP",5)==0)       {ief(&cmdb[1]); return(1);}

                else if(wcsncmp(cmdb,L"@file",5)==0)       {ief(&cmdb[1]); return(1);}

        else if(wcsncmp(cmdb,L"@FILE",5)==0)       {ief(&cmdb[1]); return(1);}

                else if(wcsncmp(cmdb,L"@www",4)==0)        {ief(&cmdb[1]); return(1);}

                else if(wcsncmp(cmdb,L"@WWW",4)==0)        {ief(&cmdb[1]); return(1);}

        else if(wcsncmp(cmdb,L"@exec ",6)==0)      {execf(0,&cmdb[6]); return(1);}

        else if(wcsncmp(cmdb,L"@exec8 ",7)==0)     {execf(8,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@exec9 ",7)==0)     {execf(9,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@exec10 ",8)==0)    {execf(10,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@execl ",7)==0)     {execf(0,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@execlp ",8)==0)    {execf(1,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@execle ",8)==0)    {execf(2,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@execlpe ",9)==0)   {execf(3,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@execv ",7)==0)     {execf(4,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@execvp ",8)==0)    {execf(5,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@execve ",8)==0)    {execf(6,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@execvpe ",9)==0)   {execf(7,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@spawn ",7)==0)     {spawnf(0,&cmdb[7]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawn8 ",8)==0)    {spawnf(8,&cmdb[8]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawn9 ",8)==0)    {spawnf(9,&cmdb[8]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawn10 ",9)==0)   {spawnf(10,&cmdb[9]);  return(1);}

        else if(wcsncmp(cmdb,L"@spawn11 ",9)==0)   {spawnf(11,&cmdb[9]);  return(1);}

        else if(wcsncmp(cmdb,L"@spawnl ",8)==0)    {spawnf(0,&cmdb[8]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawnlp ",9)==0)   {spawnf(1,&cmdb[9]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawnle ",9)==0)   {spawnf(2,&cmdb[9]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawnlpe ",10)==0) {spawnf(3,&cmdb[10]);  return(1);}

        else if(wcsncmp(cmdb,L"@spawnv ",8)==0)    {spawnf(4,&cmdb[8]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawnvp ",9)==0)   {spawnf(5,&cmdb[9]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawnve ",9)==0)   {spawnf(6,&cmdb[9]);   return(1);}

        else if(wcsncmp(cmdb,L"@spawnvpe ",10)==0) {spawnf(7,&cmdb[10]);  return(1);}

        else if(wcsncmp(cmdb,L"@sie ",5)==0)       {spawnf(11,&cmdb[5]);  return(1);}

        else if(wcsncmp(cmdb,L"@SIE ",5)==0)       {spawnf(11,&cmdb[5]);  return(1);}

        else if(wcsncmp(cmdb,L"@sex ",5)==0)       {spawnf(12,&cmdb[5]);  return(1);}

                else if(wcsncmp(cmdb,L"@SEX ",5)==0)       {spawnf(12,&cmdb[5]);  return(1);}

        else if(wcsncmp(cmdb,L"@snote ",7)==0)     {spawnf(13,&cmdb[7]);  return(1);}

        else if(wcsncmp(cmdb,L"@sword ",7)==0)     {spawnf(14,&cmdb[7]);  return(1);}

        else if(wcsncmp(cmdb,L"@soasys ",8)==0)    {spawnf(17,&cmdb[8]);  return(1);}

        else if(wcsncmp(cmdb,L"@sexcel ",8)==0)    {spawnf(15,&cmdb[8]);  return(1);}

        else if(wcsncmp(cmdb,L"@soutlook",9)==0)   {spawnf(16,&cmdb[0]);  return(1);}

        else if(wcsncmp(cmdb,L"@sie ",5)==0)       {spawnf(11,&cmdb[5]);  return(1);}

        else if(wcsncmp(cmdb,L"@sie ",5)==0)       {spawnf(11,&cmdb[5]);  return(1);}

        else if( wcscmp(cmdb,L"@url")==0)             {urlf();return(1);}

                else if(wcsncmp(cmdb,L"@exchelp ",9)==0)      {helpf(&cmdb[9]);return(1);}

        else if(wcsncmp(cmdb,L"@pathdir ",  9)==0)  {pathdirf(excpath, &cmdb[ 9]);return(1);}

        else if(wcsncmp(cmdb,L"@path2dir ",10)==0)  {pathdirf(excpath2,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path1dir ",10)==0)  {pathdirf(excpath1,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path3dir ",10)==0)  {pathdirf(excpath3,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path4dir ",10)==0)  {pathdirf(excpath4,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path5dir ",10)==0)  {pathdirf(excpath5,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path6dir ",10)==0)  {pathdirf(excpath6,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path7dir ",10)==0)  {pathdirf(excpath7,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path8dir ",10)==0)  {pathdirf(excpath8,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@path9dir ",10)==0)  {pathdirf(excpath9,&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@pathroot ",10)==0)  {pathrootf(&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@pathsub ", 9)==0)   {pathsubf(&cmdb[9]);return(1);}

        else if(wcsncmp(cmdb,L"@findsub ", 9)==0)   {findsubf(&cmdb[9]);return(1);}

        else if(wcsncmp(cmdb,L"@findfile ",10)==0)  {findfilef(&cmdb[10]);return(1);}

        else if(wcsncmp(cmdb,L"@ftype ",7)==0)      {ftypef(&cmdb[7]);return(1);}

        else if(wcscmp(cmdb,L"@cwd")==0)            {wprintf(L"\n cwd=%s",cwdf());return(1);}

        else if(wcscmp(cmdb,L"@CWD")==0)            {wprintf(L"\n cwd=%s",cwdf());return(1);}

        else if(wcscmp(cmdb,L"@env")==0)            {envf(0);return(1);}

        else if(wcscmp(cmdb,L"@ENV")==0)            {envf(1);return(1);}

        else if(wcscmp(cmdb,L"@errlist")==0)        {errlistf(0);return(1);}

        else if( wcscmp(cmdb,L"@helplist")==0)      {helplistf();return(1);}

                else if(wcsicmp(cmdb,L"@envset")==0)         {envsetf();return(1);}       

        else if(wcsncmp(cmdb,L"@exccmd ",8)==0)  {excf(&cmdb[8]); return(1);}

            else if(wcsncmp(cmdb,L"@EXCCMD ",8)==0)  {excf(&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@dir /q ",8)==0)  {xdirf(1,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR /Q ",8)==0)  {xdirf(1,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@dir /a ",8)==0)  {xdirf(0,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR /A ",8)==0)  {xdirf(0,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@dir /s ",8)==0)  {xdirf(2,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR /S ",8)==0)  {xdirf(2,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@dir /x ",8)==0)  {xdirf(3,&cmdb[8]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR /X ",8)==0)  {xdirf(3,&cmdb[8]); return(1);}

        else if(wcscmp(cmdb,L"@dir /q")==0)      {xdirf(1,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR /Q")==0)      {xdirf(1,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir /a")==0)      {xdirf(0,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR /A")==0)      {xdirf(0,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir /s")==0)      {xdirf(2,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR /S")==0)      {xdirf(2,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir /x")==0)      {xdirf(3,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR /X")==0)      {xdirf(3,cdirb); return(1);}

        else if(wcsncmp(cmdb,L"@dir/q ",7)==0)  {xdirf(1,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/Q ",7)==0)  {xdirf(1,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@dir/a ",7)==0)  {xdirf(0,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/A ",7)==0)  {xdirf(0,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@dir/s ",7)==0)  {xdirf(2,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/S ",7)==0)  {xdirf(2,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@dir/x ",7)==0)  {xdirf(3,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/X ",7)==0)  {xdirf(3,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@dir/t:c ",9)==0)  {xdirf(4,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/T:C ",9)==0)  {xdirf(4,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@dir/t:a ",9)==0)  {xdirf(5,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/T:A ",9)==0)  {xdirf(5,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@dir/t:w ",9)==0)  {xdirf(6,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/T:W ",9)==0)  {xdirf(6,&cmdb[9]); return(1);}

        else if(wcsncmp(cmdb,L"@dir/b ",7)==0)  {xdirf(7,&cmdb[7]); return(1);}

        else if(wcsncmp(cmdb,L"@DIR/B ",7)==0)  {xdirf(7,&cmdb[7]); return(1);}

        else if(wcscmp(cmdb,L"@dir/q")==0)  {xdirf(1,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/Q")==0)  {xdirf(1,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir/a")==0)  {xdirf(0,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/A")==0)  {xdirf(0,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir/s")==0)  {xdirf(2,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/S")==0)  {xdirf(2,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir/x")==0)  {xdirf(3,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/X")==0)  {xdirf(3,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir/b")==0)  {xdirf(7,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/B")==0)  {xdirf(7,cdirb); return(1);}

        else if(wcsncmp(cmdb,L"@dir ",5)==0)     {dirf(&cmdb[5]);return(1);}

        else if(wcsncmp(cmdb,L"@DIR ",5)==0)     {dirf(&cmdb[5]);return(1);}

            else if(wcscmp(cmdb,L"@dir")==0)         {dirf(cdirb);return(1);}

        else if(wcscmp(cmdb,L"@DIR")==0)         {dirf(cdirb);return(1);}

                else if(wcsncmp(cmdb,L"@.",2)==0)        {assocf(&cmdb[1]); return(1);}

        else if(wcsncmp(cmdb,L"@assoc ",7)==0)   {assocf(&cmdb[7]); return(1);}

        else if( wcscmp(cmdb,L"@oasys")==0)      {_wsystem(oasyss); return(1);}

                else if( wcscmp(cmdb,L"@oas")==0)        {_wsystem(oasyss); return(1);}

        else if( wcscmp(cmdb,L"@outlookex")==0)   {_wsystem(outlook2s); return(1);}

                else if( wcscmp(cmdb,L"@OUTLOOKEX")==0)   {_wsystem(outlook2s); return(1);}

                 

 

 

 

 

 

        return(0);

}

 

int      cmdf4(wchar_t  *cmdb)

{

             if(wcscmp(cmdb,L"@dir/t:c")==0)  {xdirf(4,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/T:C")==0)  {xdirf(4,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir/t:a")==0)  {xdirf(5,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/T:A")==0)  {xdirf(5,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@dir/t:w")==0)  {xdirf(6,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@DIR/T:W")==0)  {xdirf(6,cdirb); return(1);}

        else if(wcscmp(cmdb,L"@cal")==0)       {calef(); return(1);}

            else if(wcscmp(cmdb,L"@CAL")==0)       {calef(); return(1);}

                else if(wcscmp(cmdb,L"@cale")==0)      {calef(); return(1);}

            else if(wcscmp(cmdb,L"@CALE")==0)      {calef(); return(1);}

                else if(wcsncmp(cmdb,L"@calc ",6)==0)      {calcf(&cmdb[6]); return(1);}

        else if(wcsncmp(cmdb,L"@CALC ",6)==0)      {calcf(&cmdb[6]); return(1);}

        else if(wcscmp(cmdb,L"@ave")==0)       {avef();return(1);}  

            else if(wcscmp(cmdb,L"@AVE")==0)       {avef();return(1);}  

               

        return(0);

}

 

int      cmdf5(wchar_t  *cmdb)

{

     return(0);

}

 

int      cmdf6(wchar_t  *cmdb)

{

 

        return(0);

}

 

int   findf(wchar_t *cmdb)

{

      struct   _wfinddata_t x_file;

          long      hfile;

          wchar_t   dir[1024],chf[7],tmb[1024];

      int   i;

     

           wcscpy(tmb,cmdb);

           if(wcscmp(cmdb,L"")==0)  wcscpy(cmdb,cdirb);

           if((cmdb[0]!=L'\\') &&  (cmdb[1]!=L':'))

                   swprintf(cmdb,L"%s\\%s",cdirb,tmb);

 

         

          if(dor(cmdb)==1)

               swprintf(dir,L"%s*.*",cmdb);

          else if(dor(cmdb)==0)

           swprintf(dir,L"%s\\*.*",cmdb);

          chf[6]=L'\0';i=1;

 

    

      

 

          if((hfile=_wfindfirst(dir,&x_file))== -1L)

                  wprintf(L"ファイルは存在しません。");

          else

          {

                  if(x_file.attrib & _A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

          if(x_file.attrib & _A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                  if(x_file.attrib & _A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                  if(x_file.attrib & _A_SUBDIR) chf[3]= L'D';else chf[3]=L'-';

                  if(x_file.attrib & _A_RDONLY) chf[4]= L'D';else chf[4]=L'-';

                  if((x_file.attrib & _A_NORMAL)!=0) chf[5]= L'-';else chf[5]=L'n';

                  swprintf(dirb[i],L"\n%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[i++]); 

          }

 

          while(_wfindnext(hfile,&x_file)==0)

          {

          if(x_file.attrib & _A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

          if(x_file.attrib & _A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                  if(x_file.attrib & _A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                  if(x_file.attrib & _A_RDONLY) chf[4]= L'R';else chf[4]=L'-';

                  if((x_file.attrib & _A_NORMAL)!=0) chf[5]= L'-';else chf[5]=L'n';

                  swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[i++]); 

          }

      _findclose(hfile);

 

 

    return(0);

}

 

int   findsubf(wchar_t *cmdb)

{

      struct   _wfinddata_t x_file;

          long      hfile;

          wchar_t   tmpb[256],dir[1024],chf[7];

     // int   i;

     

         

         

          if(dor(cmdb)==1)

               swprintf(dir,L"%s*.*",cmdb);

          else if(dor(cmdb)==0)

           swprintf(dir,L"%s\\*.*",cmdb);

          chf[6]=L'\0';

    

      

 

          if((hfile=_wfindfirst(dir,&x_file))== -1L)

                  wprintf(L"ファイルは存在しません。\n");

          else

          {

                  if(x_file.attrib & _A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

          if(x_file.attrib & _A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                  if(x_file.attrib & _A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                  if(x_file.attrib & _A_SUBDIR) chf[3]= L'D';else chf[3]=L'-';

                  if(x_file.attrib & _A_RDONLY) chf[4]= L'R';else chf[4]=L'-';

                  if((x_file.attrib & _A_NORMAL)!=0) chf[5]= L'-';else chf[5]=L'n';

                  swprintf(dirb[_findsubno],L"\n%04d %6s %-24s %11Ld %s",_findsubno,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[_findsubno++]); 

          }

 

          while(_wfindnext(hfile,&x_file)==0)

          {

          if(x_file.attrib & _A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

          if(x_file.attrib & _A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                  if(x_file.attrib & _A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                  if(x_file.attrib & _A_RDONLY) chf[3]= L'R';else chf[3]=L'-';

                  if(x_file.attrib & _A_SUBDIR)

                  {

                          chf[4]= L'D';

                          wcscpy(tmpb,x_file.name);

                          if(tmpb[0]==L'.') continue;

                          if((tmpb[0]==L'.') && (tmpb[1]==L'.')) continue;

                         

                          wcscpy(tmpb,cmdb);

               if(dor(cmdb)==1)

                        swprintf(cmdb,L"%s%s",tmpb,x_file.name);

                   else if(dor(cmdb)==0)

                     swprintf(cmdb,L"%s\\%s",tmpb,x_file.name);

         

              wprintf(L"DIR=%s\n",cmdb);

                          findsubf(cmdb);

                  }

                  else chf[4]=L'-';

          if((x_file.attrib & _A_NORMAL)!=0) chf[5]= L'-';else chf[5]=L'n';

                  swprintf(dirb[_findsubno],L"%04d %5s %-24s %11Ld %s",_findsubno,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[_findsubno++]); 

          }

      _findclose(hfile);

 

 

    return(0);

}

 

int   findfilef(wchar_t *cmdb)

{

      struct   _wfinddata_t x_file;

          long      hfile;

          wchar_t   tmpb[256],fdir[1024],dir[1024],chf[7],fileb[256];

      int   i;

     

         

         

      for(i=0;i<1024;++i)

          {

           if(cmdb[i]==L' ')

                   {

                           cmdb[i]=L'\0';

                           wcscpy(fileb,cmdb);

                           wcscpy(fdir,&cmdb[i+1]);cmdb[i]=L' ';

                           break;

                   }

                   else if(cmdb[i]<L' ')

                   {

               wcscpy(fileb,cmdb);

                           wcscpy(fdir,cdirb);

                           break;

                   } 

          }

 

 

 

 

 

          wcscpy(tmpb,fdir);

          if(dor(tmpb)==1)

               swprintf(dir,L"%s*.*",fdir);

          else if(dor(tmpb)==0)

           swprintf(dir,L"%s\\*.*",fdir);

         

          chf[6]=L'\0';i=1;

      

 

          if((hfile=_wfindfirst(dir,&x_file))== -1L)

                  wprintf(L"ファイルは存在しません。\n");

          else

          {

                  if(x_file.attrib & _A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

          if(x_file.attrib & _A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                  if(x_file.attrib & _A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                  if(x_file.attrib & _A_SUBDIR) chf[3]= L'D';else chf[3]=L'-';

                  if(x_file.attrib & _A_RDONLY) chf[4]= L'R';else chf[4]=L'-';

                  if((x_file.attrib & _A_NORMAL)!=0) chf[5]= L'-';else chf[5]=L'n';

 

 

                  swprintf(dirb[i],L"\n%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[i++]); 

          }

 

          while(_wfindnext(hfile,&x_file)==0)

          {

          if(x_file.attrib & _A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

          if(x_file.attrib & _A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                  if(x_file.attrib & _A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                  if(x_file.attrib & _A_RDONLY) chf[3]= L'R';else chf[3]=L'-';

                  if(x_file.attrib & _A_SUBDIR)

                  {

                          chf[4]= L'D';

                          wcscpy(tmpb,x_file.name);

                          if(tmpb[0]==L'.') continue;

                          if((tmpb[0]==L'.') && (tmpb[1]==L'.')) continue;

                         

                         

               if(dor(dir)==1)

                        swprintf(cmdb,L"%s %s%s",fileb,fdir,x_file.name);

                   else if(dor(dir)==0)

                     swprintf(cmdb,L"%s %s\\%s",fileb,fdir,x_file.name);

         

              wprintf(L"DIR=%s\n",cmdb);

                          findfilef(cmdb);

                  }

                  else chf[4]=L'-';

          if((x_file.attrib & _A_NORMAL)!=0) chf[5]= L'-';else chf[5]=L'n';

         

                  swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[i++]);

                 

          if(wcsicmp(x_file.name,fileb)==0)

                  {

 

          wprintf(L"\n %s FILE 発見\n",fileb);

                  swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[i]);

                  }

 

          }

      _findclose(hfile);

 

 

    return(0);

}

 

int   finddirf(int   mode,wchar_t  *cmdb)

{

          int    i=0,fileno=0;

          int      fileend=0;

          int         bkno=7;

          int     ffiletop=49;

          wchar_t     line[1024];

          wchar_t     line2[1024];

      wchar_t     line3[1024];

      wchar_t     tmb[1024];

          wchar_t     tmb1[1024];

  //    wchar_t     tmb2[1024];

         

         // FILE     *yomikomi,*kakikomi;

 

      struct   _wfinddata_t x_file;

          long      hfile;

          wchar_t   dir[1024],chf[7];

      wchar_t   fdirf[5000];

     

           wcscpy(tmb,cmdb);

           if(wcscmp(cmdb,L"")==0)  wcscpy(cmdb,cdirb);

           if((cmdb[0]!=L'\\') &&  (cmdb[1]!=L':'))

                   swprintf(cmdb,L"%s\\%s",cdirb,tmb);

 

         

          if(dor(cmdb)==1)

               swprintf(dir,L"%s*.*",cmdb);

          else if(dor(cmdb)==0)

           swprintf(dir,L"%s\\*.*",cmdb);

          chf[6]=L'\0';i=1;

 

    

      

      wprintf(L"\n");

          if((hfile=_wfindfirst(dir,&x_file))== -1L)

                  wprintf(L"ファイルは存在しません。");

          else

          {

                  chf[0]=(x_file.attrib & _A_ARCH  ) ?   L'a' : L'-';

                  chf[1]=(x_file.attrib & _A_HIDDEN) ?   L'H' : L'-';

                  chf[2]=(x_file.attrib & _A_SYSTEM) ?   L'S' : L'-';

                  chf[3]=(x_file.attrib & _A_SUBDIR) ?   L'D' : L'-';

                  chf[4]=(x_file.attrib & _A_NORMAL) ?   L'R' : L'-';

                  chf[5]=(x_file.attrib & _A_NORMAL) ?   L'n' : L'-';

                 

          fdirf[i]=chf[3];

 

            if(mode==0)

             swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

        else if(mode==1)

             swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_access))),x_file.size,x_file.name);

            else if(mode==2)

             swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_create))),x_file.size,x_file.name);

                else

                     swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

              _putws(dirb[i++]); 

          }

 

          while(_wfindnext(hfile,&x_file)==0)

          {

                  chf[0]=(x_file.attrib & _A_ARCH  ) ?   L'a' : L'-';

                  chf[1]=(x_file.attrib & _A_HIDDEN) ?   L'H' : L'-';

                  chf[2]=(x_file.attrib & _A_SYSTEM) ?   L'S' : L'-';

                  chf[3]=(x_file.attrib & _A_SUBDIR) ?   L'D' : L'-';

                  chf[4]=(x_file.attrib & _A_RDONLY) ?   L'R' : L'-';

                  chf[5]=(x_file.attrib & _A_NORMAL) ?   L'n' : L'-';

                 

          fdirf[i]=chf[3];

        if(mode==0)

             swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

        if(mode==1)

             swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_access))),x_file.size,x_file.name);

            if(mode==2)

             swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_create))),x_file.size,x_file.name);

            else

                     swprintf(dirb[i],L"%04d %6s %-24s %11Ld %s",i,chf,enn(_wctime( &(x_file.time_write))),x_file.size,x_file.name);

                    

                _putws(dirb[i++]); 

          }

          fileend=i-1;

      _findclose(hfile);

 

 

      enn(cmdb);cdf(cmdb);

        // _wchdir(cmdb);

   //   enn(cdirb);

    

      fnamechf(cmdb);

        swprintf(tmb,L"%s\\excdir\\dir.txt",temp);

         //pcname(cdirb,usrpcb);

   

       

       

      while(1)

          {

          fileno=bkno;

                  pcname(cmdb,usrpcb);

      wprintf(L"\ncdir=%s\n",cdirb);

      if(_usrpcf==0)

              wprintf(L"cunc=%s\n",uncb);

      if(_usrpcf==1)

              wprintf(L"GUNC=%s\n",guncb);

      wprintf(L"DIR=%s\n",cmdb);

      wprintf(L"\n@FINDDIR/RUN Line No.= ? ");_getws(tmb);

 

          if(tmb[0]==L'?') {finddirf(mode,cmdb);return(0);}

          if(tmb[0]==L'@') {finddirf(mode,cmdb);return(0);}

          if(tmb[0]==L' ') {finddirf(mode,cmdb);return(0);}

          if(tmb[0]<L' ')  return(0);

          if(tmb[0]==L'&') {_kannjif=11;wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'#') {_kannjif=0; wcscpy(tmb,&tmb[1]);i=_wtoi(tmb);goto ESTA;}

          if(tmb[0]==L'0') {finddirf(mode,cmdb);return(0);}

          if(tmb[0]==L'<'){--i;  goto ESTA;}

          if(tmb[0]==L'>'){++i;  goto ESTA;}

 

          if(tmb[0]<L'0' || tmb[0]>L'9')

          {

                       if(wcsncmp(tmb,L"@attrib /s ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if( wcscmp(tmb,L"@attrib")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB /S ",11)==0)   {attribf(1,&tmb[11]);continue;}

                  else if(wcsncmp(tmb,L"@attrib ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if(wcsncmp(tmb,L"@ATTRIB ",8)==0)       {attribf(0,&tmb[8]);continue;}

                  else if( wcscmp(tmb,L"@ATRRIB")==0)          {attribf(0,cmdb);continue;}

                  else if(wcsncmp(tmb,L"@type#",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@type ",6)==0)   {i=_wtoi(&tmb[6]);_cmdmodef=1;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@print#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=2;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@print ",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=2;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@attrib#",8)==0) {i=_wtoi(&tmb[8]);_cmdmodef=4;goto ESTA2;}

                  else if(wcsncmp(tmb,L"@xcopy$",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1001;goto ESTA;}

                  else if(wcsncmp(tmb,L"@xcopy#",7)==0)  {i=_wtoi(&tmb[7]);_cmdmodef=1002;goto ESTA;}

          else if(wcsicmp(tmb,L"@exit")==0)     

                  {   _cmdendf=1;_exitf=1;

                  wcscpy(bkcdirb,cdirb);          

                      break;

                  }

 

 

 

 

 

                  if(dor(cmdb)==0)

                               swprintf(tmb1,L"%s\\%s",cmdb,tmb);

                   else if(dor(cmdb)==1)

                          swprintf(tmb1,L"%s%s",cmdb,tmb);

                  _wsystem(tmb1);continue;

          }

          else

          {  fileno=_wtoi(tmb);bkno=fileno;_kannjif=0;}

 

 

ESTA:

          wprintf(L"\n%s",dirb[fileno]);

          if(fileno<=0) continue;

          if(fileno > fileend) continue;

     

      if(fdirf[fileno]==L'D')    // DIR

          {

                  _dirfilef=1;

                  if(_cmdmodef==1001) {_xcopyf[0]=1,_xcopyf[1]=1;}

          if(_cmdmodef==1002) _xcopyf[2]=1;

 

                  wprintf(&dirb[i][dirtop]);

                  wcscpy(line,&dirb[fileno][ffiletop]);

              fnamechf(line);

                  enn(line);

     

                  if(_usrpcf==0)

                  {

                  if(dor(cmdb)==0)

                               swprintf(line2,L"%s\\%s",cmdb,line);

                      else if(dor(cmdb)==1)

                  swprintf(line2,L"%s%s",cmdb,line);

                  }

                  else if(_usrpcf==1)

                  {

              if(dor(guncb)==0)

                           swprintf(line2,L"%s\\%s",guncb,line);

                       else if(dor(guncb)==1)

                    swprintf(line2,L"%s%s",guncb,line);

                  }

 

 

         enn(line2);

             wprintf(L"\nfinddirff() line2=%s",line2);

         fnamechf(line2);

         if(_kannjif==11)

                 {

                       swprintf(line3,L"dir \"%s\" > %s\\excdir\\dir.txt && type %s\\excdir\\dir.txt",line2,temp,temp);

                         //  swprintf(line3,L"dir %s > %s\\excdir\\dirkj.txt",line2,temp);

                           wprintf(L"finddirf() kannji %s",line3);

                       kannji(line3);

                 }

                 else  if(_kannjif==0)

                 {

                         

                        ;// dirf(line2);

                 }     

 

 

                 if(_cmdmodef==1001) {wcscpy(xcopysb[0],line2);continue;}

                 if(_cmdmodef==1002) {wcscpy(xcopysb[1],line2);systemf(_cmdmodef,cmdb);continue;}

                 finddirf(mode,line2); cdf(cmdb);

                 

          }

          else //if(fdirf[i]==L'-') // NO DIR

      {

                  _dirfilef=0;

                  if(_cmdmodef==1001) {_xcopyf[0]=1;_xcopyf[1]=0;}

          if(_cmdmodef==1002) _xcopyf[2]=0;

                  wprintf(L"\ndirtop=%s",&dirb[fileno][dirtop]);

                  wprintf(L"\nffiletop=%s",&dirb[fileno][ffiletop]);

ESTA2:    wcscpy(line,&dirb[fileno][ffiletop]);//filetop=58 fnamechf(line2);

 

       

        if(_usrpcf==0)

                {

                  if(dor(cmdb)==0)

               swprintf(line2,L"%s\\%s",cmdb,&dirb[fileno][ffiletop]);

          if(dor(cmdb)==1)

                          swprintf(line2,L"%s%s",cmdb,&dirb[fileno][ffiletop]);

                }

        if(_usrpcf==1)

                {

                  if(dor(guncb)==0)

               swprintf(line2,L"%s\\%s",guncb,&dirb[fileno][ffiletop]);

          if(dor(guncb)==1)

                          swprintf(line2,L"%s%s",guncb,&dirb[fileno][ffiletop]);

                }

 

       

        fnamechf(line2);

                if(_fnamef==1)

                swprintf(line3,L"\"%s\"",line2);

                else if(_fnamef==0)

                        wcscpy(line3,line2);

                wprintf(L"\n finddirf() No dir line3=%s",line3);

                if(line3[0]<L' ') return(0);

        enn(line3);

                if(_cmdmodef==1001) {wcscpy(xcopysb[0],line3);continue;}

        if(_cmdmodef==1002) {wcscpy(xcopysb[1],line3);}

 

 

                if(_kannjif==11) 

                  {

                          kannji(line3);

                  }

                else if(_kannjif==0)

                  {systemf(_cmdmodef,line3);}           // line2);

        }

          }//while  end

 

      return(0);

}

 

int  ctimef(void)

{

    time_t   ltime;

 

 

        time(&ltime);

 

        wprintf(L"\n%s",_wctime(&ltime));

 

 

        return(0);

}

 

int   helpf(wchar_t *cmdb)

{

    int   i,filesu,su;

    wchar_t   fname[225];

    wchar_t   cmd[225];

    wchar_t   help[50];

 

        FILE     *yomikomi;

 

    swprintf(fname,L"%s\\excdir\\@help.exc",temp);

    swprintf(cmd,L"help > %s",fname);

 

        if((yomikomi = _wfopen(fname,L"r")) == NULL)

                _wsystem(cmd);

 

    if((yomikomi = _wfopen(fname,L"r")) == NULL)

             wprintf(L"No File %s",fname);

        wprintf(L"\n");

    for(i=1;i<5000;++i)

        {

                if(fgetws(dirb[i],225,yomikomi) == NULL) {filesu=i-1;break;}

                else

                {

                        wprintf(L"%04d %s",i,dirb[i]);

                }

        }

 

 

 

        while(1)

        {

    wprintf(L"\nHELP /? No.= ? ");_getws(help);

        if(help[0]<L' ') break;

        su=_wtoi(help);

    if(su<=1) continue;

        if(su>filesu) su=filesu;

        if(dirb[su][0]==L' ') continue;

 

    for(i=0;i<20;++i)

        {

                if(dirb[su][i]==L' ') dirb[su][i]=L'\0';

        }

        swprintf(cmd,L"%s /?",dirb[su]);_wsystem(cmd);

        }

 

 

        return(0);

}

 

int   kennsaku(wchar_t *cmdb)

{

     wchar_t  fname[1024];

 

     _wsearchenv(cmdb,L"PATH",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"PATH %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname=%s",fname);

         _wsystem(fname);return(0);

     }

         _wsearchenv(cmdb,L"excpath",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname1=%s",fname);

         _wsystem(fname);return(0);

         }

 

         _wsearchenv(cmdb,L"excpath2",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Execpath2 No FILE! %s",cmdb);

         }

         else

         {

         wprintf(L"\nfname2=%s",fname);

         _wsystem(fname);return(0);

         }

 

         

         _wsearchenv(cmdb,L"excpath3",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname3=%s",fname);

         _wsystem(fname);return(0);

         }

     

         _wsearchenv(cmdb,L"excpath4",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath4 %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname4=%s",fname);

         _wsystem(fname);return(0);

         }

 

         _wsearchenv(cmdb,L"excpath5",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname5=%s",fname);

         _wsystem(fname);return(0);

         }

 

         _wsearchenv(cmdb,L"excpath6",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath6 %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname6=%s",fname);

         _wsystem(fname);return(0);

         }

 

         _wsearchenv(cmdb,L"excpath7",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath7 %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname7=%s",fname);

         _wsystem(fname);return(0);

         }

 

         _wsearchenv(cmdb,L"excpath8",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath8 %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname8=%s",fname);

         _wsystem(fname);return(0);

         }

 

         _wsearchenv(cmdb,L"excpath9",fname);

         if(wcscmp(fname,L"")==0)

         {

                 wprintf(L"Excpath9 %s No FILE! ",cmdb);

         }

         else

         {

         wprintf(L"\nfname9=%s",fname);

         _wsystem(fname);return(0);

         }

 

       

         _wsystem(cmdb);

     return(0);

}

 

 

int      execf(int   mode,wchar_t *cmdb)

{

      wchar_t    arg[20][5000];

          wchar_t    *argp[20];

          wchar_t    *env[]={

                  L"envhelp=help",

          L"envset=set",

                  L"\0"

          };

      int     i,j,s;

      int     tenntenn=0;

     

         

          for(i=0;i<20;++i)

          {

                  argp[i]=&arg[i][0];wcscpy(arg[i],L"\0");

          }

 

          for(i=0;i<5000;++i)

          {

                  if(cmdb[i]<L' ') {cmdb[i]=L'\0';break;}

                  else  if(cmdb[0]==L' ') wcscpy(cmdb,&cmdb[1]);

          }

 

 

      for(i=0,j=0,s=0;i<5000;++i)

          {

                  if(cmdb[0]==L'\"') tenntenn=1;

                  if(i==0) s=0;

                  if(j>=19) break;

                  if(cmdb[i]<L' ') {cmdb[i]=L'\0';wcscpy(arg[j],&cmdb[s]);*arg[j+1]=NULL;break;}

 

          if(cmdb[i]==L'\"')

                  {

                          if((tenntenn==0)  && (cmdb[i-1]==L' ')) tenntenn=1;

                          if((tenntenn==1) && (cmdb[i+1]==L' ')) tenntenn=0;

                  }

 

 

          if((cmdb[i]==L' ') && (cmdb[i+1]!=L' ') && (tenntenn==0))

                  {

                          cmdb[i]=L'\0';wcscpy(arg[j++],&cmdb[s]);

                          s=i+1;

                  }

          }

          for(i=0;i<2;++i)

          {

                  if(wcscmp(env[i],L"")==0) break;

                  else

                  wprintf(L"\nenv[%d]=%s",i,env[i]);

          }

          for(i=0;i<20;++i)

          {

          if(wcscmp(arg[i],L"")==0) break;

                  else    wprintf(L"\nargp[%d]=%s",i,argp[i]);

          }

 

          if(mode==0)

          {

            if(_wexecl(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0')== (-1) )

                                wprintf(L"\n _wexecl() err!");

                else  return(1);

          }

      else if(mode==1)

          {

            if(_wexeclp(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0')== (-1) )

                                wprintf(L"\n _wexeclp() err!");

                else  return(1);

          }

      else if(mode==2)

          {

            if(_wexecle(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                                wprintf(L"\n _wexecle() err!");

                else  return(1);

          }

      else if(mode==3)

          {

            if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                                wprintf(L"\n _wexeclp() err!");

                else  return(1);

          }              

          else if(mode==8)

          {

          //  if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                        //      wprintf(L"\n _wexeclpe() err!");

                if(_wexeclp(ex,ex,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wexeclpe() err!");

              else  return(1);

          }

      else if(mode==4)

          {

            if(_wexecv(arg[0],argp)== (-1) ) wprintf(L"\n _wexecv() err!");

                else  return(1);

          }

      else if(mode==5)

          {

            if(_wexecvp(arg[0],argp)== (-1) ) wprintf(L"\n _wexecvp() err!");

                else  return(1);

          }

      else if(mode==6)

          {

            if(_wexecve(arg[0],argp,env)== (-1) ) wprintf(L"\n _wexecve() err!");

                else  return(1);

          }

          else if(mode==7)

          {

            if(_wexecvpe(arg[0],argp,env)== (-1) ) wprintf(L"\n _wexecvpe() err!");

                else  return(1);

          }

      else if(mode==8)

          {

          //  if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                        //      wprintf(L"\n _wexeclpe() err!");

                if(_wexeclp(ex,ex,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wexeclpe() err!");

              else  return(1);

          }

          else  if(mode==9)

          {

          //  if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                        //      wprintf(L"\n _wexeclpe() err!");

                if(_wexeclp(note,note,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wexeclpe() err!");

              else  return(1);

          }

           if(mode==10)

          {

          //  if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                        //      wprintf(L"\n _wexeclpe() err!");

                if(_wexeclp(ie,ies,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wexeclpe() err!");

              else  return(1);

          }

 

        return(0);

}

 

int      spawnf(int   mode,wchar_t *cmdb)

{

      //wchar_t    arg[20][5000];

          //wchar_t    *argp[20];

         

      int     i,j,s;

      int     tenntenn=0;

     

          _fileinfo=1;

 

 

          for(i=0;i<20;++i)

          {

                  argp[i]=&arg[i][0];wcscpy(arg[i],L"\0");

          }

 

          for(i=0;i<5000;++i)

          {

                  if(cmdb[i]<L' ') {cmdb[i]=L'\0';break;}

                  else  if(cmdb[0]==L' ') wcscpy(cmdb,&cmdb[1]);

          }

 

 

      for(i=0,j=0,s=0;i<5000;++i)

          {

                  if(cmdb[0]==L'\"') {tenntenn=1;continue;}

                  if(i==0) s=0;

                  if(j>=19) break;

                  if(cmdb[i]<L' ') {cmdb[i]=L'\0';wcscpy(arg[j],&cmdb[s]);argp[j+1]=NULL;break;}

 

          if(cmdb[i]==L'\"')

                  {

                          if((tenntenn==0)  && (cmdb[i-1]==L' ')) tenntenn=1;

                          if((tenntenn==1) && (cmdb[i+1]==L' ')) tenntenn=0;

                  }

 

 

          if((cmdb[i]==L' ') && (cmdb[i+1]!=L' ') && (tenntenn==0))

                  {

                          cmdb[i]=L'\0';wcscpy(arg[j++],&cmdb[s]);

                          s=i+1;

                  }

          }

          for(i=0;i<20;++i)

          {

                  if(env[i]==NULL) {wprintf(L"\nenv[%d]=NULL",i);break;}

                  if(wcscmp(env[i],L"")==0) {wprintf(L"\nenv[%d]=NULL",i);break;}

                  else

                  wprintf(L"\nenv[%d]=%s",i,env[i]);

          }

          for(i=0;i<20;++i)

          {

          if(argp[i]==NULL) {wprintf(L"\narg[%d]=NULL",i);break;}

                  if(wcscmp(arg[i],L"")==0) {wprintf(L"\nargp[%d]=NULL",i);break;}

                  else    wprintf(L"\nargp[%d]=%s",i,argp[i]);

          }

 

          if(mode==0)

          {

            if(_wspawnl(_P_WAIT,arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0')== (-1) )

                                wprintf(L"\n _wspawnl() err!");

                else  return(1);

          }

      else if(mode==1)

          {

            if(_wspawnlp(_P_WAIT,arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() err!");

                else  return(1);

          }

      else if(mode==2)

          {

            if(_wspawnle(_P_WAIT,arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                                wprintf(L"\n _wspawnle() err!");

                else  return(1);

          }

          else if(mode==3)

          {

            if(_wspawnlpe(_P_WAIT,arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                                wprintf(L"\n _wspawnle() err!");

                else  return(1);

          }

    

      else if(mode==18)

          {

                if(_wspawnlpe(_P_WAIT,L"f:\\test.cmd",L"f:\\test.cmd",L'\0',env)== (-1) )

                                wprintf(L"\n _wspawnle() err!");

                else  return(1);

          }

                 

          else if(mode==8)

          {

          //  if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                        //      wprintf(L"\n _wexeclpe() err!");

                if(_wspawnlp(_P_WAIT,ex,ex,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlpe() err!");

              else  return(1);

          }

          else if(mode==9)

          {

          //  if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                        //      wprintf(L"\n _wexeclpe() err!");

                  if(_wspawnlp(_P_WAIT,note,note,L"\\test.cmd",L'\0')== (-1) )

                                wprintf(L"\n _wspawnlpe() err!");

              else  return(1);

          }

      else if(mode==10)

          {

          //  if(_wexeclpe(arg[0],arg[0],arg[1],arg[2],arg[3],arg[4],arg[5],arg[6],arg[7],arg[8],arg[9],L'\0',env)== (-1) )

                        //      wprintf(L"\n _wexeclpe() err!");

                  if(_wspawnlp(_P_WAIT,ie,ies,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlpe() err!");

              else  return(1);

          }

      else if(mode==11)

          {

           if(_wspawnlp(_P_NOWAIT,ie,ies,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() no. %d err!",errno);

              else  return(1);

          }

          else if(mode==12)

          {

           if(_wspawnlp(_P_NOWAIT,ex,ex,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() errno.= %d err!",errno);

              else  return(1);

          }

          else if(mode==13)

          {

           if(_wspawnlp(_P_NOWAIT,note,note,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() errno.= %d err!",errno);

              else  return(1);

          }

          else if(mode==14)

          {

           if(_wspawnlp(_P_NOWAIT,word,words,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() errno.= %d err!",errno);

              else  return(1);

          }

          else if(mode==15)

          {

           if(_wspawnlp(_P_NOWAIT,excel,excels,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() errno.= %d err!",errno);

              else  return(1);

          }

          else if(mode==16)

          {

           if(_wspawnlp(_P_NOWAIT,outlook2,outlook2s,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() errno.= %d err!",errno);

              else  return(1);

          }

          else if(mode==17)

          {

           if(_wspawnlp(_P_NOWAIT,oasys,oasyss,arg[0],L'\0')== (-1) )

                                wprintf(L"\n _wspawnlp() errno.= %d  err!",errno);

              else  return(1);

          }

      else if(mode==4)

          {

                  wcscpy(arg[0],L"test.cmd");*arg[1]=NULL;

                  if(_wspawnv(_P_WAIT,L"f:\\test.cmd",argp)== (-1) ) wprintf(L"\n _wspawnv() err!");

                else  return(1);

          }

      else if(mode==5)

          {

                  wcscpy(arg[0],L"test.cmd");*arg[1]=NULL;

                  if(_wspawnvp(_P_WAIT,L"f:\\test.cmd",argp)== (-1) ) wprintf(L"\n _wspawnvp() err!");

                else  return(1);

          }

      else if(mode==6)

          {

                  wcscpy(arg[0],L"test.cmd");*arg[1]=NULL;

                 

            if(_wspawnve(_P_WAIT,L"f:\\test.cmd",argp,env)== (-1) ) wprintf(L"\n _wspawnve() err!");

                else  return(1);

          }

          else if(mode==7)

          {

                  if(_wspawnvpe(_P_WAIT,argp[0],argp,_wenviron)== (-1) ) wprintf(L"\n _wspawnvpe() err!");

                else  return(1);

          }

     

 

        return(0);

}

 

int   envsetf(void)

{

     int i;

     FILE    *yomikomi;

     wchar_t   temb[1024];

         wchar_t  fname[256];

         wchar_t   *tem;

 

     tem=_wgetenv(L"SystemDrive");

         swprintf(fname,L"%s\\temp\\excdir\\envset.txt",tem);

       if((yomikomi=_wfopen(fname,L"r"))== L'\0')

           {

                   wprintf(L"No FILE %s!",fname);

           }

           else

           {

           wprintf(L"\n");

           for(i=1;i<=300;++i)

               {

             wcscpy(temb,L"");

             fgetws(temb,1024,yomikomi);

                         if(wcscmp(temb,L"")==0) break;

                         wprintf(L"%03d %s",i,temb);enn(temb);

                         if(_wputenv(temb)== -1)

                         {

                                 wprintf(L"putenv err!\n");

                         }

               }

           }

       fclose(yomikomi);

   

 

     return(0);

}

 

int   urlf(void)

{

       int   i,urlsu=0;

 

           FILE   *yomikomi;

           wchar_t   fname[256];

           wchar_t   cmd[256];

 

 

           tem=_wgetenv(L"TEMP");

           swprintf(fname,L"%s\\excdir\\urllist.txt",tem);

       if((yomikomi=_wfopen(fname,L"r"))== L'\0')

           {

                   wprintf(L"No FILE %s!",fname);

           }

           else

           {

           wprintf(L"\n");

           for(i=1;i<=300;++i)

               {

             fgetws(urlb[i],256,yomikomi);

                         if(wcscmp(urlb[i],L"")==0) break;

                         wprintf(L"%04d %s",i,urlb[i]);

             zenngo(urlb[i],urlname[i],urlhttp[i]);

 

               }

           }

       fclose(yomikomi);

       while(1)

           {

 

           wprintf(L"\nURL No.= ? ");_getws(cmd);

           if(wcscmp(cmd,L"")==0) break;

       if((cmd[0]>L'0') && (cmd[0]<='9'))

           {

                   urlsu=_wtoi(cmd);

 

               wprintf(L"\n%s URL=%s",urlname[urlsu],urlhttp[urlsu]);

          

               _wspawnlp(_P_NOWAIT,ie,ies,urlhttp[urlsu],L'\0');

          

           }

           else

           {

                   if(cmd[0]!='@') {_wsystem(cmd);continue;}

                   else if(wcscmp(cmd,L"@urllist")==0) {_wsystem(fname);continue;}

           }

 

          

          

           }

 

 

 

 

 

 

       return(1);

}

 

int     zenngo(wchar_t  *moto,wchar_t *mae,wchar_t   *usiro)

{

          int   i;

 

          for(i=0;i<256;++i)

                  {

                          if(moto[i]<L' ') {moto[i]=L'\0';break;}

                          if((moto[i]==L'=')  && (i<50))

                          {

                                  moto[i]=L'\0';

                                  wcscpy(mae,moto);wcscpy(usiro,&moto[i+1]);break;

                          }

                  }

 

     return(0);

}

 

int    pathdirf(wchar_t *pathb,wchar_t *fileb)

{

     wchar_t   tmpathb[1024],fullnameb[1024];

     int    i,l,s,su=0,lsu=0;

     struct    _wfinddata_t ptfname;

         long     hFile;

     wchar_t  chf[10],tmpb[256];

 

      chf[5]=L'\0';

 

         wcscpy(tmpathb,excpath2b);

 

     for(i=0;i<1024;++i)

         {

          if(tmpathb[i]<L' ') break;

                  else if(tmpathb[i]=='=') wcscpy(tmpathb,&tmpathb[i+1]);

         }

 

 

         for(i=0,l=1,s=0;i<1024;++i)

         {

                 if(l>=49)  break;

                 if(tmpathb[i]<L' ') break;

                 else if(tmpathb[i]==L';')

                 {

                         if((i>2) && (tmpathb[i-1]==L'\\')) tmpathb[i-1]=L'\0';

                         tmpathb[i]=L'\0';

             wcscpy(pathdirb[l],&tmpathb[s]);

                         wprintf(L"\n%02d %s",l,pathdirb[l]);

                         s=i+1;l++;

                 }

         }

 

    

         for(l=1;l<49;++l)

         {

                 wcscpy(tmpathb,pathdirb[l]);_wchdir(tmpathb);

                 if(wcscmp(tmpathb,L"")==0) break;

                 if((pathdirb[l][2]==L'\\') && (pathdirb[l][3]<=L'\0'))

         wcscat(tmpathb,L"*.*");

                 else wcscat(tmpathb,L"\\*.*");

 

                 if((hFile= _wfindfirst(tmpathb,&ptfname)) != -1L)

                 {

                         if((pathdirb[l][2]==L'\\') && (pathdirb[l][3]==L'\0'))

                         swprintf(fullnameb,L"%s%s",pathdirb[l],ptfname.name);

                         else

                 swprintf(fullnameb,L"%s\\%s",pathdirb[l],ptfname.name);

                         wprintf(L"\nfilefirst%d=%s",l,fullnameb);

                 }

                 else break;

                 while(_wfindnext(hFile,&ptfname)==0)

                 {

                         if(wcscmp(ptfname.name,fileb)==0)

                         {

                  if((pathdirb[l][2]==L'\\') && (pathdirb[l][3]<=L'\0'))

                                          swprintf(fullnameb,L"%s%s",pathdirb[l],ptfname.name);

                              else

                      swprintf(fullnameb,L"%s\\%s",pathdirb[l],ptfname.name);

                         

                          wprintf(L"\nfilenext%d=%s",l,fullnameb);

               wcscpy(dirb[++su],fullnameb);

 

                           if(ptfname.attrib==_A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

               if(ptfname.attrib==_A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                       if(ptfname.attrib==_A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                       if(ptfname.attrib==_A_SUBDIR) chf[3]= L'D';else chf[3]=L'-';

                       if(ptfname.attrib!=_A_NORMAL) chf[4]= L'-';else chf[4]=L'n';

                        swprintf(tmpb,L"\n%04d %5s %-24s %-11Ld %s",su,chf,enn(_wctime( &(ptfname.time_write))),ptfname.size,ptfname.name);

                   _putws(tmpb);

                           wprintf(L"\n CREATE=%s  ACCESS=%s ",enn(_wctime( &(ptfname.time_create))),enn(_wctime( &(ptfname.time_access))));

              

         

                         }

                 }

         _findclose(hFile);

         }

         wprintf(L"\nPATHDIR/RUN  FileNo.= ? ");_getws(tmpb);lsu=_wtoi(tmpb);

     if(lsu<1) lsu=1;if(lsu>su) lsu=su;

         if(wcscmp(dirb[lsu],L"")!=0)

              _wsystem(dirb[lsu]);

 

 

        return(1);

}

 

int    pathrootf(wchar_t *pathb)

{

     wchar_t   tmpathb[1024],fullnameb[1024];

     int    i,l,su=0,lsu=0;

     struct    _wfinddata_t ptfname;

         long     hFile;

     wchar_t  chf[10],tmpb[256],fileb[256];

 

      chf[5]=L'\0';

 

         wcscpy(tmpathb,pathb);

     _wgetcwd(cdirb,256);

 

         for(i=0;i<256;++i)

         {

                 if(pathb[i]<L' ')

                 {

                         pathb[i]=L'\0';

             break;

                 }

                 if(pathb[i]==L' ')

                 {

              pathb[i]=L'\0';

              wcscpy(tmpathb,pathb);

                          wcscpy(fileb,&pathb[i+1]);

                 }

         }

 

 

         

 

     if((tmpathb[0]!=L'\\') && (tmpathb[1]!=L':'))

         swprintf(tmpathb,L"%s\\%s",cdirb,tmpathb);

 

       

         for(i=0,l=1;i<1024;++i)

         {

                 if(l>=49)  break;

               

                 if((tmpathb[i]==L'\\') && (tmpathb[i+1]!=L'\0'))

                 {

                         tmpathb[i]=L'\0';

             wcscpy(pathdirb[l],&tmpathb[0]);tmpathb[i]=L'\\';

                         wprintf(L"\n%02d %s",l,pathdirb[l]);

                         l++;

                 }

         if(tmpathb[i]<L' ')

                 {

                         wcscpy(pathdirb[l],&tmpathb[0]);

                         wprintf(L"\n%02d %s",l,pathdirb[l]);

                         tmpathb[i]=L'\0';break;

                 }

         }

 

     wprintf(L"\nfile=%s",fileb);

    

          pathdirb[1][0]=L'\\';pathdirb[1][1]=L'\0';

 

         for(l=1;l<49;++l)

         {

                 wcscpy(tmpathb,pathdirb[l]);_wchdir(tmpathb);

                 if(wcscmp(tmpathb,L"")==0) break;

                 if((pathdirb[l][0]==L'\\') && (pathdirb[l][1]<L' '))

         wcscat(tmpathb,L"*.*");

                 else if((pathdirb[l][1]==L':') && (pathdirb[l][2]==L'\\') && (pathdirb[l][1]<L' '))

         wcscat(tmpathb,L"*.*");

                 else wcscat(tmpathb,L"\\*.*");

 

                 if((hFile= _wfindfirst(tmpathb,&ptfname)) != -1L)

                 {

                         if((pathdirb[l][0]==L'\\') && (pathdirb[l][1]<L' '))

                  wcscat(tmpathb,L"*.*");

                     else if((pathdirb[l][1]==L':') && (pathdirb[l][2]==L'\\') && (pathdirb[l][3]<L' '))

                         swprintf(fullnameb,L"%s%s",pathdirb[l],ptfname.name);

                         else

                 swprintf(fullnameb,L"%s\\%s",pathdirb[l],ptfname.name);

                         wprintf(L"\nfilefirst%d=%s",l,fullnameb);

                 }

                 else break;

                 while(_wfindnext(hFile,&ptfname)==0)

                 {

                         if(wcscmp(ptfname.name,fileb)==0)

                         {

                                  if((pathdirb[l][0]==L'\\') && (pathdirb[l][1]<L' '))

                       wcscat(tmpathb,L"*.*");

                          else if((pathdirb[l][1]==L':') && (pathdirb[l][2]==L'\\') && (pathdirb[l][3]<L' '))

                                          swprintf(fullnameb,L"%s%s",pathdirb[l],ptfname.name);

                              else

                      swprintf(fullnameb,L"%s\\%s",pathdirb[l],ptfname.name);

                         

                          wprintf(L"\nfilenext%d=%s",l,fullnameb);

               wcscpy(dirb[++su],fullnameb);

 

                           if(ptfname.attrib==_A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

               if(ptfname.attrib==_A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                       if(ptfname.attrib==_A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                       if(ptfname.attrib==_A_SUBDIR) chf[3]= L'D';else chf[3]=L'-';

                       if(ptfname.attrib!=_A_NORMAL) chf[4]= L'-';else chf[4]=L'n';

                        swprintf(tmpb,L"\n%04d %5s %-24s %-11Ld %s",su,chf,enn(_wctime( &(ptfname.time_write))),ptfname.size,ptfname.name);

                   _putws(tmpb);

                           wprintf(L"\n CREATE=%s  ACCESS=%s ",enn(_wctime( &(ptfname.time_create))),enn(_wctime( &(ptfname.time_access))));

              

         

                         }

                 }

         _findclose(hFile);

         }

         wprintf(L"\nPATHDIR/RUN  FileNo.= ? ");_getws(tmpb);lsu=_wtoi(tmpb);

     if(lsu<1) lsu=1;if(lsu>su) lsu=su;

         if(wcscmp(dirb[lsu],L"")!=0)

              _wsystem(dirb[lsu]);

 

 

        return(1);

}

 

int    pathsubf(wchar_t *pathb)

{

     wchar_t   tmpathb[1024],fullnameb[1024];

     int    i,l,su=0,s,lsu=0;

     struct    _wfinddata_t ptfname;

         long     hFile;

     wchar_t  chf[10],tmpb[256],fileb[256];

 

      chf[5]=L'\0';

 

         wcscpy(tmpathb,pathb);

     _wgetcwd(cdirb,256);

 

         for(i=0;i<256;++i)

         {

                 if(pathb[i]<L' ')

                 {

                         pathb[i]=L'\0';

             break;

                 }

                 if(pathb[i]==L' ')

                 {

              pathb[i]=L'\0';

              wcscpy(fileb,pathb);

              wcscpy(tmpathb,&pathb[i+1]);pathb[i]=L' ';

                          break;

                 }

         }

 

 

         

 

     if((tmpathb[0]!=L'\\') && (tmpathb[1]!=L':'))

         swprintf(tmpathb,L"%s\\%s",cdirb,tmpathb);

 

       

         for(i=0,l=1,s=0;i<1024;++i)

         {

                 if(l>=49)  break;

               

                 if((tmpathb[i]==L' ') && (tmpathb[i+1]!=L'\0'))

                 {

                         tmpathb[i]=L'\0';

             wcscpy(pathdirb[l],&tmpathb[s]);tmpathb[i]=L' ';

                         wprintf(L"\n%02d %s",l,pathdirb[l]);

                         l++;s=i+1;

                 }

         if(tmpathb[i]<L' ')

                 {

                         wcscpy(pathdirb[l],&tmpathb[s]);

                         wprintf(L"\n%02d %s",l,pathdirb[l]);

                         tmpathb[i]=L'\0';break;

                 }

         }

 

     wprintf(L"\nfile=%s",fileb);

    

          pathdirb[1][0]=L'\\';pathdirb[1][1]=L'\0';

 

         for(l=1;l<49;++l)

         {

                 wcscpy(tmpathb,pathdirb[l]);_wchdir(tmpathb);

                 if(wcscmp(tmpathb,L"")==0) break;

                 if((pathdirb[l][0]==L'\\') && (pathdirb[l][1]<L' '))

         wcscat(tmpathb,L"*.*");

                 else if((pathdirb[l][1]==L':') && (pathdirb[l][2]==L'\\') && (pathdirb[l][1]<L' '))

         wcscat(tmpathb,L"*.*");

                 else wcscat(tmpathb,L"\\*.*");

 

                 if((hFile= _wfindfirst(tmpathb,&ptfname)) != -1L)

                 {

                         if((pathdirb[l][0]==L'\\') && (pathdirb[l][1]<L' '))

                  wcscat(tmpathb,L"*.*");

                     else if((pathdirb[l][1]==L':') && (pathdirb[l][2]==L'\\') && (pathdirb[l][3]<L' '))

                         swprintf(fullnameb,L"%s%s",pathdirb[l],ptfname.name);

                         else

                 swprintf(fullnameb,L"%s\\%s",pathdirb[l],ptfname.name);

                         wprintf(L"\nfilefirst%d=%s",l,fullnameb);

                 }

                 else break;

                 while(_wfindnext(hFile,&ptfname)==0)

                 {

                         if(wcscmp(ptfname.name,fileb)==0)

                         {

                                  if((pathdirb[l][0]==L'\\') && (pathdirb[l][1]<L' '))

                       wcscat(tmpathb,L"*.*");

                          else if((pathdirb[l][1]==L':') && (pathdirb[l][2]==L'\\') && (pathdirb[l][3]<L' '))

                                          swprintf(fullnameb,L"%s%s",pathdirb[l],ptfname.name);

                              else

                      swprintf(fullnameb,L"%s\\%s",pathdirb[l],ptfname.name);

                         

                          wprintf(L"\nfilenext%d=%s",l,fullnameb);

               wcscpy(dirb[++su],fullnameb);

 

                           if(ptfname.attrib==_A_ARCH)   chf[0]= L'A';else chf[0]=L'-';

               if(ptfname.attrib==_A_HIDDEN) chf[1]= L'H';else chf[1]=L'-';

                       if(ptfname.attrib==_A_SYSTEM) chf[2]= L'S';else chf[2]=L'-';

                       if(ptfname.attrib==_A_SUBDIR) chf[3]= L'D';else chf[3]=L'-';

                       if(ptfname.attrib!=_A_NORMAL) chf[4]= L'-';else chf[4]=L'n';

                        swprintf(tmpb,L"\n%04d %5s %-24s %-11Ld %s",su,chf,enn(_wctime( &(ptfname.time_write))),ptfname.size,ptfname.name);

                   _putws(tmpb);

                           wprintf(L"\n CREATE=%s  ACCESS=%s ",enn(_wctime( &(ptfname.time_create))),enn(_wctime( &(ptfname.time_access))));

              

         

                         }

                 }

         _findclose(hFile);

         }

         wprintf(L"\nPATHDIR/RUN  FileNo.= ? ");_getws(tmpb);lsu=_wtoi(tmpb);

     if(lsu<1) lsu=1;if(lsu>su) lsu=su;

         if(wcscmp(dirb[lsu],L"")!=0)

              _wsystem(dirb[lsu]);

 

 

        return(1);

}

 

int     ftypef(wchar_t  *cmdb)

{

       wchar_t    fileb[265],tmpb[1024],expb[50],ftypeb[256],s[100];

       int   i,expsu;

       FILE     *yomikomi;

 

       wcscpy(fileb,cmdb);

           for(i=0;i<256;++i)

           {

                   if(cmdb[i]==L'.')

                   {

                           wcscpy(expb,&cmdb[i]);break;

                   }

                   else if(cmdb[i]<L' ')

                   {

                 break;

                   }

           }

       expsu=wcslen(expb);

 

           swprintf(tmpb,L"assoc > %s\\excdir\\excassoc.txt",temp);_wsystem(tmpb);

       swprintf(tmpb,L"ftype > %s\\excdir\\excftype.txt",temp);_wsystem(tmpb);

 

           swprintf(tmpb,L"%s\\excdir\\excassoc.txt",temp);

 

       wprintf(L"\n");

       if((yomikomi=_wfopen(tmpb,L"r"))==NULL)

                   wprintf(L"\n %s No FILE ",tmpb);

           else

           {

                   for(i=1;i<5000;++i)

                   {

                   if(fgetws(dirb[i],256,yomikomi)== NULL) break;

               if(_wcsnicmp(dirb[i],expb,expsu)==0)

                           {

                     wcscpy(ftypeb,&dirb[i][expsu+1]);

                                         break;

                           }

                           wprintf(L"%04d %s",i,dirb[i]);

                   }

           }

       fclose(yomikomi);

 

       wprintf(L"\n %04d %s typefile=%s",i,dirb[i],ftypeb);

 

      

 

           expsu=wcslen(ftypeb)-1;

           swprintf(tmpb,L"%s\\excdir\\excftype.txt",temp);

       wprintf(L"\n");

       if((yomikomi=_wfopen(tmpb,L"r"))==NULL)

                   wprintf(L"\n %s No FILE ",tmpb);

           else

           {

                   for(i=1;i<5000;++i)

                   {

                           if(i>200) break;

                   if(fgetws(dirb[i],256,yomikomi)== NULL) break;

               if(_wcsnicmp(dirb[i],ftypeb,expsu)==0)

                           {

                     wcscpy(tmpb,&dirb[i][expsu+1]);

                                         break;

                           }

                           wprintf(L"%04d %s",i,dirb[i]);

                   }

           }

       fclose(yomikomi);

 

       wprintf(L"\n %04d %s %s %d cmdbfile=%s",i,dirb[i],ftypeb,expsu,tmpb);

       wprintf(L"\n RUN (y/n) ");_getws(s);

           if(s[0]!=L'y')  return(1);

 

           swprintf(cmdb,L"echo %s > %s\\excdir\\batcmd\\$exccmd.cmd",enn(tmpb),temp);

           _wsystem(cmdb);

       swprintf(cmdb,L"%s\\excdir\\batcmd\\$exccmd.cmd %s",temp,fileb);

           _wsystem(cmdb);

 

        return(0);

}

 

 

int    envf(int envmode)

{

        int   i;

    wchar_t    tmpb[256];

 

 

        FILE     *yomidasi;

 

        swprintf(tmpb,L"set > %s\\excdir\\envplist.txt",temp);

        _wsystem(tmpb);

    swprintf(tmpb,L"%s\\excdir\\envplist.txt",temp);

    wprintf(L"\n");

 

     for(i=0;i<100;i++)

         {

          extenvp[i]=&extenvb[i][0];

         }

 

 if(envmode==0)

 {

         for(i=0;i<100;i++)

         {

         if(_wenviron[i]==NULL) break;

         if(wcscmp(_wenviron[i],L"")==NULL) break;

                 wcscpy(extenvb[i],_wenviron[i]);

                 wprintf(L"\n%02d %s",i+1,extenvp[i]);

         }

 }

 else if(envmode!=0)

 {

    wprintf(L"\n");

        if((yomidasi=_wfopen(tmpb,L"r"))==NULL)

                wprintf(L"\n%s NO FULE!",temp);

        else

        {

        for(i=0;i<100;++i)

            {

                        if(fgetws(extenvb[i],1024,yomidasi)==NULL) break;

                    wprintf(L"%02d %s",i+1,extenvp[i]);

                  

            }

        }

    fclose(yomidasi);

 }

 

        return(0);

}

 

int    errnof(void)

{

      if(_doserrno==ECHILD)

                  wprintf(L"\n errno %d=ECHILD 子プロセスが存在しなうい。",errno);

          else if(_doserrno==EAGAIN)

          wprintf(L"\n errno %d=EAGAIN   ",errno);

      else if(_doserrno=E2BIG)

          wprintf(L"\n errno %d=E2BIG  %s  ",errno,_sys_errlist[_sys_nerr]);

          else if(_doserrno=EACCES)

          wprintf(L"\n errno %d=EACCES   ",errno);

          else if(_doserrno=EBADF)

          wprintf(L"\n errno %d=EBADF    ",errno);

          else if(_doserrno=EDEADLOCK)

          wprintf(L"\n errno %d=EDEADLOCK   ",errno);

      else if(_doserrno=EDOM)

          wprintf(L"\n errno %d=EDOM      ",errno);

 

 

      return(_doserrno);    

}

 

int    errlistf(int j)

{

    char  *tmpp;

    int    i;

 

 

    for(i=0;i<20;i++)

        {

        tmpp=_sys_errlist[i];

        if(*tmpp==NULL) return(0);

    wprintf(L"\n_sys_errlist[%d]=%s",i,tmpp);

        }

        return(0);

}

 

int    doserrnof(void)

{

      if(_doserrno==ECHILD)

                  wprintf(L"\n errno %d=ECHILD 子プロセスが存在しなうい。",_doserrno);

          else if(_doserrno==EAGAIN)

          wprintf(L"\n errno %d=EAGAIN   ",_doserrno);

      else if(_doserrno=E2BIG)

          wprintf(L"\n errno %d=E2BIG  %s  ",_doserrno,_sys_errlist[_sys_nerr]);

          else if(_doserrno=EACCES)

          wprintf(L"\n errno %d=EACCES   ",_doserrno);

          else if(_doserrno=EBADF)

          wprintf(L"\n errno %d=EBADF    ",_doserrno);

          else if(_doserrno=EDEADLOCK)

          wprintf(L"\n errno %d=EDEADLOCK   ",_doserrno);

      else if(_doserrno=EDOM)

          wprintf(L"\n errno %d=EDOM      ",_doserrno);

 

 

      return(_doserrno);    

 

}

 

void  calef(void)

{   

     char    string[512];

     char     bf[512];

     short   tuki,tosi,mototosi,mototuki;     //d_tuki,d_tosi

     void    cal(char *,short,short);

     void    cal12(char *,short);

 

         char  yb[10],mb[10];

 

     time_t t;

     

 

      

      _strdate(yb);

 

      tosi=atoi(&yb[6])+2000 ;    //d_tosi=d.da_year;

 

          strncpy(mb,yb,2);

     tuki=atoi(mb);      //d_tuki=d.da_mon;

 

     mototosi=tosi;

         mototuki=tuki;

     printf("year=%d month=%d",tosi,tuki);

 

     while(1)

         {

     printf("\n Year=yyyy ???? > ");

     gets(bf);

     if(bf[0]=='\0') {tosi=mototosi;}

     else if(bf[0]=='@') break;

     else if(bf[0]=='<' || bf[0]=='+') {tosi++;}

     else if(bf[0]=='>' || bf[0]=='-') {tosi--;}

     else if((bf[0]>='0')  && ( bf[0]<='9'))

                 tosi=atoi(bf);

         if(tosi<=999) tosi+=2000;

 

     printf("\nMonth=mm ?? > ");

     gets(bf);

     if(bf[0]=='\0')  {tuki=mototuki;}

     else if(bf[0]=='@') break;

     else if(bf[0]=='<' || bf[0]=='+')

         {

                 tuki++;

         if(tuki>12)

                 {

                         tosi++;tuki=1;

                 }

         }

     else if(bf[0]=='>' || bf[0]=='-')

         {

                 tuki--;

                 if(tuki<1)

                 {

                         tosi--;tuki=12;

                 }

         }

     else if((bf[0]>='0') && (bf[0]<='9'))

                 tuki=atoi(bf);

     if(tuki<1 ||  tuki >12) {cal12(string,tosi);continue;}

    // if((tosi<100)  && (tosi>=50)) tosi+=1900;

     //if((tosi<100) && (tosi<50)) tosi+=2000;

     if(tosi<1752) {printf("\nNo yuriusu reki< gurigori reki>!!");continue;}

     if((tosi==1752) && (tuki<9))

         {printf("\nNo yuriusu reki<gurigori reki>!!");continue;}

     if((tosi==1752) && (tuki==9))

        {printf("\ngurigori reki(1〜2)=>yuriusu reki(14〜30)");

         printf("\n   9 Septenber 1752 ");

         printf("\n Sn Mo Tu We Th Fr Sa");

         printf("\n        1  2|14 15 16");

         printf("\n 17 18 19 20 21 22 23");

         printf("\n 24 25 26 27 28 28 30");

         t=time(NULL);printf("\n%s",ctime(&t));

         continue;}

     if(tosi>30000) {printf("\n muimi !! ");break;}

    

    

     cal(string,tuki,tosi);

     t=time(NULL);printf("\n%s",ctime(&t));

     }

  

    

}

 

void  cal(char  *string,short  tuki,short  tosi)

{

 

     register short   i;

 

     for(i=0;i < (6*72+10); ++i) string[i]='\0';

    

     calset(tuki,tosi,string,24);

 

 

     printf("\n   %d %s %d",tuki,tukimei[tuki],tosi);

     printf("\n%s",syuu);

 

 

     for(i=0;i<6*24;i+=24){

          calprn(string+i,24);

     }

}

void  cal12(char *string,short  tosi)

{

 

     void  calset(short,short,char *,short);

     void  calprn(char * ,short);

     short   tuki;

     register short   i;

//     char     bf[512];

         

     printf("\n%35d",tosi);

    

     for(tuki=1;tuki<=12;tuki +=3)

     {

          for(i=0;i < (6*72+10); ++i) string[i]='\0';

         

          printf("\n%12.3s(%2d)%19.3s(%2d)%19.3s(%2d)",

          tukimei[tuki],tuki,tukimei[tuki+1],tuki+1,tukimei[tuki+2],tuki+2);

          printf("\n%s  %s  %s",syuu,syuu,syuu);

         

          calset(tuki,tosi,string,72);

          calset(tuki+1,tosi,string+23,72);

          calset(tuki+2,tosi,string+46,72);

         

          for(i=0;i < 6*72; i +=72) calprn(string+i,72);

      //    if(tuki>=7)

      //    {

      //         fprintf(stderr,"\n%35d   ",tosi);gets(bf);

      //   }    

    }

}    

 

void  calset(short  tuki,short tosi,char  string[],short w)

{                           /*  1  2  3  4  5  6  7  8  9 10 11 12 */

      static short  month[]={0,31,28,31,30,31,30,31,31,30,31,30,31};

      register   char   *p,*s;

      register   short   d,i;

      int dotwll(short);

 

      month[2]=(dotwll(tosi+1) == (((d=dotwll(tosi))+1) % 7)) ? 28:29;

 

      for(i=1;i<tuki;i++) d += month[i];

      d %= 7;

      p=string;

      s=string+3*d;

      for(i=1;i<=month[tuki];i++)

      {

          if(i>9)  *s=i/10+'0';

          s++;

          *s++ =i%10+'0';

          s++;

          if(++d ==7)

          {

               d=0;

               s=p+w;

               p=s;

          }    

      }

 

}

 

int dotwll(short  tosi)

{

     register   short y;

 

     y=tosi-1;

     return((tosi+y/4-y/100+y/400) % 7);

}

 

void calprn(char *string,short n)

{

     register  short  i;

     register  char   *s;

    

     s=string;

     i=n;

 

     while(i--)

         if(*s++ == '\0') s[-1]=' ';

     i=n+1;

     while(i--)

         if(*--s != ' ') break;

     s[1]='\0';

 

     printf( "\n %s",string);

                                 

 

}                      

 

 

int    avef(void)

{

      int   i,j,kazu;

      char   b[256];

          long double   su[103],su2[103];

          long double   ave,max,min,sd,sigma,cv;

      int    prnf;

      wchar_t  wps[113][80];

      wchar_t   fname[1024];

 

          FILE     *kakikomi;

 

          printf("\n");

          for(i=1,kazu=0;i<100;i++)

          {

      printf(" %2d     ",i);gets(b);

      if(b[0]=='t' || b[0]=='T')

          {

                  printf("No.?=");gets(b);j=atoi(b);

                  if(j<=1) j=1;

                  else if(j>(i-1)) j=(i-1);

                  printf("su ?=");gets(b);su[j]=atof(b);printf("No.%d=%f\n",j,su[j]);

                  if(su[j]==0.0) break;

                  --i;

          }

          else

               su[i]=atof(b);

         

          if(b[0]<' ' || b[0]=='z' || b[0]=='Z') break;

          if(b[0]=='p' || b[0]=='P') {prnf=1;break;}

 

          if(su[i]==0.0) break;

         

          }

          kazu=i-1;

 

          ave=0.0;max=0.0;min=su[1];su[0]=0.0;su2[0]=0.0;

 

          for(i=1;i<=kazu;i++)

          {

          su[0]+=su[i];

          if(max<su[i]) max=su[i];

                  if(min>su[i]) min=su[i];

                  printf("\n %2d     %f",i,su[i]);

          }

          if(kazu<=1) return(0);

          ave=su[0]/kazu;

          for(i=1;i<kazu;i++)

          {

           su2[i]=(su[i]-ave)*(su[i]-ave);

           su2[0]+=su2[i];

          }

      sd=sqrt(su2[0]/kazu);

          sigma=sqrt(su2[0]/(kazu-1));   

      cv=sd/ave*100;

 

          printf("\n      N=%d",kazu);

          printf("\n    AVE=%f",ave);

          printf("\n    MAX=%f",max);

          printf("\n    MIN=%f",min);

          printf("\n      r=%f",(max-min));

          printf("\n  σ(n)=%f",sd);

      printf("\nσ(n-1)=%f",sigma);     

      printf("\n     CV=%f%%",cv);

 

 

          if(prnf==1)

          {

 

          for(i=1;i<=kazu;i++)

                  {

          swprintf(wps[i],L"\n %2d     %f",i,su[i]);           

          }

          swprintf(wps[i+1],L"\n       N=%d",kazu);

          swprintf(wps[i+2],L"\n     AVE=%f",ave);

              swprintf(wps[i+3],L"\n     MAX=%f",max);

              swprintf(wps[i+4],L"\n     MIN=%f",min);

              swprintf(wps[i+5],L"\n       r=%f",(max-min));

              swprintf(wps[i+6],L"\n   σ(n)=%f",sd);

          swprintf(wps[i+7],L"\n σ(n-1)=%f",sigma);     

          swprintf(wps[i+8],L"\n      CV=%f%%",cv);

 

                  swprintf(fname,L"%s\\excdir\\avetxt.txt",temp);

 

          if((kakikomi=_wfopen(fname,L"w"))!=NULL)

                  {

                for(i=1;i<= ( kazu+10);++i)

                                {

                                        fwprintf(kakikomi,L"%s",wps[i]);

                                        wprintf(wps[i]);

                                }

                  }

                  else

                          wprintf(L"avef() _wfopen() ERR  %s ",fname);

                  fclose(kakikomi);

 

 

 

          }

        return(0);

}

 

 

long   double    nextf(char    *b)

{

         long   double  z;

     int    i,j,k;

         char     s[256];

 

 

         for(i=0,k=0;i<256;++i)

         {

         if(b[i]=='\0')  break;

                 else if(b[i]==',')

                 {

            j=0;k++;

                 }

                 else if(k==1)

                 {

                         if((b[i]>='0') && (b[i]<='9')  || b[i]=='.')

                         {s[j]=b[i];++j;}

             else  {s[j]='\0';break;}

                 }

                         

                if(b[i]=='\n' || b[i]=='\r') {b[i]='\0';break;}

 

         }

         if(k==1)  {z=atof(s);return(z);}

 

 

         

 

       return(0.0);

}

 

long    double   mathf(char   *b)

{

      int   i;

          int    migi=0,hidari=0;

      long   double  x,y,z;

      long   il,xl,yl,zl;

 

          for(i=0;i<100;++i)

          {

                  if(b[0]=='\0') break;

          if(b[0]==' ')  strcpy(&b[0],&b[1]);

                  else if(b[0]=='\0' || b[0]=='\n' || b[0]=='\r')

                  {

                          b[0]='\0';break;

                  }

          }

 

          for(i=0;i<100;++i)

          {

                  if(b[i]=='(' ||  b[i]=='[' || b[i]=='{') ++hidari;

                  else if(b[i]==')' || b[i]==']' || b[i]=='}') ++migi;

                  else if(b[i]=='\0' || b[i]=='\n' || b[i]=='\r') break;

                  else if(b[i]=='=')  {b[i]='\0';break;}

          }

 

 

      if(strcmp(b,"r?")==0 || strcmp(b,"R?")==0)

          {

                  for(i=0;i<40;++i)

                          printf("\nr[%2d]=%19.18f",i,r[i]);return(0.0);

          }

      if(strcmp(b,"r0")==0 || strcmp(b,"R0")==0)

          {

                  z=r[0];return(z);

          }

      else if(strcmp(b,"r1")==0 || strcmp(b,"R1")==0)

          {

                  z=r[1];return(z);

          }

      else if(strcmp(b,"r2")==0 || strcmp(b,"R2")==0)

          {

                  z=r[2];return(z);

          }

      else if(strcmp(b,"r3")==0 || strcmp(b,"R3")==0)

          {

                  z=r[3];return(z);

          }

      else if(strcmp(b,"r4")==0 || strcmp(b,"R4")==0)

          {

                  z=r[4];return(z);

          }

      else if(strcmp(b,"r5")==0 || strcmp(b,"R5")==0)

          {

                  z=r[5];return(z);

          }

      else if(strcmp(b,"r6")==0 || strcmp(b,"R6")==0)

          {

                  z=r[6];return(z);

          }

      else if(strcmp(b,"r7")==0 || strcmp(b,"R7")==0)

          {

                  z=r[7];return(z);

          }

      else if(strcmp(b,"r8")==0 || strcmp(b,"R8")==0)

          {

                  z=r[8];return(z);

          }

      else if(strcmp(b,"r9")==0 || strcmp(b,"R9")==0)

          {

                  z=r[9];return(z);

          }

      else if(strcmp(b,"r10")==0 || strcmp(b,"R10")==0)

          {

                  z=r[10];return(z);

          }

      else if(strcmp(b,"r11")==0 || strcmp(b,"R11")==0)

          {

                  z=r[11];return(z);

          }

 

         if((b[0]=='r' || b[0]=='R') && ((b[1]>='0') && (b[1]<='9')) && ((b[2]>='0') && (b[2]<='9')))

         {

                 i=atoi(&b[1]);if(i<0) i=0;if(i>39) i=39;

                 z=r[i];printf("\nr[%d]=%19.18f",i,z);return(z);

         }

 

         if(strcmp(b,"pi")==0 || strcmp(b,"PI")==0)

     {z=3.14159265358979323846;return(z);}

     else if(strcmp(b,"e")==0 || strcmp(b,"E")==0)

     { z=2.71828182845904523536;return(z);}

 

 

          if(hidari<=0  || hidari >= 2)  return(0.0);

          if(migi <=0   || migi >= 2)    return(0.0);

 

          if(strncmp(b,"r(",2)==0 || strncmp(b,"R(",2)==0 || strncmp(b,"r[",2)==0 || strncmp(b,"R[",2)==0 )

          {

                  i=atoi(&b[2]);z=r[i];return(z);

          }

 

     if(strncmp(b,"sin(",4)==0 || strncmp(b,"SIN(",4)==0)

         {

          x=atof(&b[4]);z=sinl(x);return(z);

         }

     else if(strncmp(b,"cos(",4)==0 || strncmp(b,"COS(",4)==0)

         {

          x=atof(&b[4]);z=cosl(x);return(z);

         }

         else if(strncmp(b,"asin(",5)==0 || strncmp(b,"ASIN(",5)==0)

         {

          x=atof(&b[5]);z=asinl(x);return(z);

         }

         else if(strncmp(b,"acos(",5)==0 || strncmp(b,"ACOS(",5)==0)

         {

          x=atof(&b[5]);z=acosl(x);return(z);

         }

         else if(strncmp(b,"tan(",4)==0 || strncmp(b,"TAN(",4)==0)

         {

          x=atof(&b[4]);z=tanl(x);return(z);

         }

     else if(strncmp(b,"atan(",5)==0 || strncmp(b,"ATAN(",5)==0)

         {

          x=atof(&b[5]);z=atanl(x);return(z);

         }

     else if(strncmp(b,"cosh(",5)==0 || strncmp(b,"COSH(",5)==0)

         {

          x=atof(&b[5]);z=coshl(x);return(z);

         }

         else if(strncmp(b,"tanh(",5)==0 || strncmp(b,"TANH(",5)==0)

         {

          x=atof(&b[5]);z=tanhl(x);return(z);

         }

         else if(strncmp(b,"sqrt(",5)==0 || strncmp(b,"SQRT(",5)==0)

         {

          x=atof(&b[5]);z=sqrtl(x);return(z);

         }

         else if(strncmp(b,"sinh(",5)==0 || strncmp(b,"SINH(",5)==0)

         {

          x=atof(&b[5]);z=sinhl(x);return(z);

         }

         else if(strncmp(b,"exp(",4)==0 || strncmp(b,"EXP(",4)==0)

         {

          x=atof(&b[4]);z=expl(x);return(z);

         }

     else if(strncmp(b,"log(",4)==0 || strncmp(b,"LOG(",4)==0)

         {

          x=atof(&b[4]);z=logl(x);return(z);

         }

         else if(strncmp(b,"log10(",6)==0 || strncmp(b,"LOG10(",6)==0)

         {

          x=atof(&b[6]);z=log10l(x);return(z);

         }

         else if(strncmp(b,"pow(",4)==0 || strncmp(b,"POW(",4)==0)

         {

                  x=atof(&b[4]);y=nextf(&b[4]);z=powl(x,y);return(z);

         }

         else if(strncmp(b,"atan2(",6)==0 || strncmp(b,"ATAN2(",6)==0)

         {

          x=atof(&b[6]);y=nextf(&b[6]);z=atan2l(x,y);return(z);

         }

         

         else if(strncmp(b,"fmod(",5)==0 || strncmp(b,"FMOD(",5)==0)

         {

          x=atof(&b[5]);y=nextf(&b[5]);z=fmodl(x,y);return(z);

         }

         else if(strncmp(b,"sum(",4)==0 || strncmp(b,"SUM(",4)==0)

         {

                 xl=atol(&b[4]);yl=(long)nextf(&b[4]);

                 if(yl<=0)

                         for(il=1,zl=0l;il<=xl;++il)

                                 zl=zl+il;

         else

                 {

                         if(yl<=xl) {return(0.0);}

                         else

                         for(il=1l,zl=0l;il<=(yl-xl);++il)

                         {

                                 zl=zl+(xl+il);

                         }

                }

        z=(long double)zl;

        return(z);

         }

         else if(strncmp(b,"kai(",4)==0 || strncmp(b,"KAI(",4)==0)

         {

          x=atoi(&b[4]);

                  for(i=1,z=1;i<=x;++i)

                     z=z*i;

                  return(z);

         }

 

 

 

 

 

 

 

 

 

         if(strncmp(b,"exp(",4)==0)

         {

          x=atof(&b[4]);z=expl(x);return(z);

         }

     if(strncmp(b,"exp(",4)==0)

         {

          x=atof(&b[4]);z=expl(x);return(z);

         }

         if(strncmp(b,"exp(",4)==0)

         {

          x=atof(&b[4]);z=expl(x);return(z);

         }

     

 

 

        return(0.0);

}

 

int     calcf(wchar_t   *wb)

{

     long double   z=0.0;

         int       i,j,k,m,kazu;

     char      c[5];

     char     fs[5][100];

         char     math[10][100];

         long  double    f[5];

         char     b[4000];

 

     for(i=0;i<4000;++i)

         {

                 b[i]=(char)wb[i];

                 if(wb[i]<L' ') {b[i]='\0';break;}

         }

 

     for(i=0,j=0,k=0,m=0,kazu=0;i<4000;++i)

         {

                 if((b[i]>='0') && (b[i]<='9') ||  b[i]=='.')

                 {     fs[j][k++]=b[i];}

                 if(b[i]=='+' || b[i]=='-' || b[i]=='*'  || b[i]=='/')

                 {

                         fs[j][k]='\0';                     math[j][m]='\0';

                         

                         if(mathf(&math[j][0])==0.0)

                         {

             f[j]=atof(fs[j]);

                         }

                         else

                         {

                         f[j]=mathf(&math[j][0]);

                         }

 

             k=0;                                    m=0;

                         c[j]=b[i];

                         ++kazu;++j;  

                         

                 }

         else if(b[i]=='\0' || b[i]=='\n' || b[i]=='\r')

                 {

             fs[j][k]='\0';                     math[j][m]='\0';             

                         

             if(mathf(&math[j][0])==0.0)

                         {

              f[j]=atof(fs[j]);

                         }

                         else

                         {

                         f[j]=mathf(&math[j][0]);

                         }

                                                                         

             b[i]='\0';break;

                 }

                 else

                 {

                         math[j][m++]=b[i];

                 }

 

         }

 

         if(kazu==0)  z=f[0];

 

     if(kazu==1)

         {

                 if(c[0]=='-')

                 {

                         z=f[0]-f[1];

                 }

         else if(c[0]=='+')

                 {

                         z=f[0]+f[1];

                 }

                 else if(c[0]=='*')

                 {

                         z=f[0]*f[1];

                 }

                 else if(c[0]=='/')

                 {

                         z=f[0]/f[1];

                 }

                 

     }

 

         if(kazu==2)

         {

                      if((c[0]=='-') && (c[1]=='-')) {z=f[0]-f[1]-f[2];}

                 else if((c[0]=='-') && (c[1]=='+')) {z=f[0]-f[1]+f[2];}

                 else if((c[0]=='-') && (c[1]=='*')) {z=f[0]-f[1]*f[2];}

                 else if((c[0]=='-') && (c[1]=='/')) {z=f[0]-f[1]/f[2];}

 

              if((c[0]=='+') && (c[1]=='-')) {z=f[0]+f[1]-f[2];}

                 else if((c[0]=='+') && (c[1]=='+')) {z=f[0]+f[1]+f[2];}

                 else if((c[0]=='+') && (c[1]=='*')) {z=f[0]+f[1]*f[2];}

                 else if((c[0]=='+') && (c[1]=='/')) {z=f[0]+f[1]/f[2];}

 

                      if((c[0]=='*') && (c[1]=='-')) {z=f[0]*f[1]-f[2];}

                 else if((c[0]=='*') && (c[1]=='+')) {z=f[0]*f[1]+f[2];}

                 else if((c[0]=='*') && (c[1]=='*')) {z=f[0]*f[1]*f[2];}

                 else if((c[0]=='*') && (c[1]=='/')) {z=f[0]*f[1]/f[2];}

 

                      if((c[0]=='/') && (c[1]=='-')) {z=f[0]/f[1]-f[2];}

                 else if((c[0]=='/') && (c[1]=='+')) {z=f[0]/f[1]+f[2];}

                 else if((c[0]=='/') && (c[1]=='*')) {z=f[0]/f[1]*f[2];}

                 else if((c[0]=='/') && (c[1]=='/')) {z=f[0]/f[1]/f[2];}

 

         }

 

         if(kazu==3)

         {

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='-')) {z=f[0]-f[1]-f[2]-f[3];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='-')) {z=f[0]-f[1]+f[2]-f[3];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='-')) {z=f[0]-f[1]*f[2]-f[3];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='-')) {z=f[0]-f[1]/f[2]-f[3];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='-')) {z=f[0]+f[1]-f[2]-f[3];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='-')) {z=f[0]+f[1]+f[2]-f[3];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='-')) {z=f[0]+f[1]*f[2]-f[3];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='-')) {z=f[0]+f[1]/f[2]-f[3];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='-')) {z=f[0]*f[1]-f[2]-f[3];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='-')) {z=f[0]*f[1]+f[2]-f[3];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='-')) {z=f[0]*f[1]*f[2]-f[3];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='-')) {z=f[0]*f[1]/f[2]-f[3];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='-')) {z=f[0]/f[1]-f[2]-f[3];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='-')) {z=f[0]/f[1]+f[2]-f[3];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='-')) {z=f[0]/f[1]*f[2]-f[3];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='-')) {z=f[0]/f[1]/f[2]-f[3];}

 

 

              if((c[0]=='-') && (c[1]=='-') && (c[2]=='+')) {z=f[0]-f[1]-f[2]+f[3];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='+')) {z=f[0]-f[1]+f[2]+f[3];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='+')) {z=f[0]-f[1]*f[2]+f[3];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='+')) {z=f[0]-f[1]/f[2]+f[3];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='+')) {z=f[0]+f[1]-f[2]+f[3];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='+')) {z=f[0]+f[1]+f[2]+f[3];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='+')) {z=f[0]+f[1]*f[2]+f[3];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='+')) {z=f[0]+f[1]/f[2]+f[3];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='+')) {z=f[0]*f[1]-f[2]+f[3];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='+')) {z=f[0]*f[1]+f[2]+f[3];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='+')) {z=f[0]*f[1]*f[2]+f[3];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='+')) {z=f[0]*f[1]/f[2]+f[3];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='+')) {z=f[0]/f[1]-f[2]+f[3];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='+')) {z=f[0]/f[1]+f[2]+f[3];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='+')) {z=f[0]/f[1]*f[2]+f[3];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='+')) {z=f[0]/f[1]/f[2]+f[3];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='*')) {z=f[0]-f[1]-f[2]*f[3];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='*')) {z=f[0]-f[1]+f[2]*f[3];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='*')) {z=f[0]-f[1]*f[2]*f[3];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='*')) {z=f[0]-f[1]/f[2]*f[3];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='*')) {z=f[0]+f[1]-f[2]*f[3];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='*')) {z=f[0]+f[1]+f[2]*f[3];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='*')) {z=f[0]+f[1]*f[2]*f[3];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='*')) {z=f[0]+f[1]/f[2]*f[3];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='*')) {z=f[0]*f[1]-f[2]*f[3];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='*')) {z=f[0]*f[1]+f[2]*f[3];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='*')) {z=f[0]*f[1]*f[2]*f[3];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='*')) {z=f[0]*f[1]/f[2]*f[3];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='*')) {z=f[0]/f[1]-f[2]*f[3];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='*')) {z=f[0]/f[1]+f[2]*f[3];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='*')) {z=f[0]/f[1]*f[2]*f[3];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='*')) {z=f[0]/f[1]/f[2]*f[3];}

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='/')) {z=f[0]-f[1]-f[2]/f[3];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='/')) {z=f[0]-f[1]+f[2]/f[3];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='/')) {z=f[0]-f[1]*f[2]/f[3];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='/')) {z=f[0]-f[1]/f[2]/f[3];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='/')) {z=f[0]+f[1]-f[2]/f[3];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='/')) {z=f[0]+f[1]+f[2]/f[3];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='/')) {z=f[0]+f[1]*f[2]/f[3];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='/')) {z=f[0]+f[1]/f[2]/f[3];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='/')) {z=f[0]*f[1]-f[2]/f[3];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='/')) {z=f[0]*f[1]+f[2]/f[3];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='/')) {z=f[0]*f[1]*f[2]/f[3];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='/')) {z=f[0]*f[1]/f[2]/f[3];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='/')) {z=f[0]/f[1]-f[2]/f[3];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='/')) {z=f[0]/f[1]+f[2]/f[3];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='/')) {z=f[0]/f[1]*f[2]/f[3];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='/')) {z=f[0]/f[1]/f[2]/f[3];}

 

         }

 

 

         if(kazu==4)

         {

         

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='-') && (c[3]=='+')) {z=f[0]-f[1]-f[2]-f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='-') && (c[3]=='+')) {z=f[0]-f[1]+f[2]-f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='-') && (c[3]=='+')) {z=f[0]-f[1]*f[2]-f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='-') && (c[3]=='+')) {z=f[0]-f[1]/f[2]-f[3]+f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='-') && (c[3]=='+')) {z=f[0]+f[1]-f[2]-f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='-') && (c[3]=='+')) {z=f[0]+f[1]+f[2]-f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='-') && (c[3]=='+')) {z=f[0]+f[1]*f[2]-f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='-') && (c[3]=='+')) {z=f[0]+f[1]/f[2]-f[3]+f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='-') && (c[3]=='+')) {z=f[0]*f[1]-f[2]-f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='-') && (c[3]=='+')) {z=f[0]*f[1]+f[2]-f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='-') && (c[3]=='+')) {z=f[0]*f[1]*f[2]-f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='-') && (c[3]=='+')) {z=f[0]*f[1]/f[2]-f[3]+f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='-') && (c[3]=='+')) {z=f[0]/f[1]-f[2]-f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='-') && (c[3]=='+')) {z=f[0]/f[1]+f[2]-f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='-') && (c[3]=='+')) {z=f[0]/f[1]*f[2]-f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='-') && (c[3]=='+')) {z=f[0]/f[1]/f[2]-f[3]+f[4];}

 

 

              if((c[0]=='-') && (c[1]=='-') && (c[2]=='+') && (c[3]=='+')) {z=f[0]-f[1]-f[2]+f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='+') && (c[3]=='+')) {z=f[0]-f[1]+f[2]+f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='+') && (c[3]=='+')) {z=f[0]-f[1]*f[2]+f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='+') && (c[3]=='+')) {z=f[0]-f[1]/f[2]+f[3]+f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='+') && (c[3]=='+')) {z=f[0]+f[1]-f[2]+f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='+') && (c[3]=='+')) {z=f[0]+f[1]+f[2]+f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='+') && (c[3]=='+')) {z=f[0]+f[1]*f[2]+f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='+') && (c[3]=='+')) {z=f[0]+f[1]/f[2]+f[3]+f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='+') && (c[3]=='+')) {z=f[0]*f[1]-f[2]+f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='+') && (c[3]=='+')) {z=f[0]*f[1]+f[2]+f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='+') && (c[3]=='+')) {z=f[0]*f[1]*f[2]+f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='+') && (c[3]=='+')) {z=f[0]*f[1]/f[2]+f[3]+f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='+') && (c[3]=='+')) {z=f[0]/f[1]-f[2]+f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='+') && (c[3]=='+')) {z=f[0]/f[1]+f[2]+f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='+') && (c[3]=='+')) {z=f[0]/f[1]*f[2]+f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='+') && (c[3]=='+')) {z=f[0]/f[1]/f[2]+f[3]+f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='*') && (c[3]=='+')) {z=f[0]-f[1]-f[2]*f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='*') && (c[3]=='+')) {z=f[0]-f[1]+f[2]*f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='*') && (c[3]=='+')) {z=f[0]-f[1]*f[2]*f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='*') && (c[3]=='+')) {z=f[0]-f[1]/f[2]*f[3]+f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='*') && (c[3]=='+')) {z=f[0]+f[1]-f[2]*f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='*') && (c[3]=='+')) {z=f[0]+f[1]+f[2]*f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='*') && (c[3]=='+')) {z=f[0]+f[1]*f[2]*f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='*') && (c[3]=='+')) {z=f[0]+f[1]/f[2]*f[3]+f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='*') && (c[3]=='+')) {z=f[0]*f[1]-f[2]*f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='*') && (c[3]=='+')) {z=f[0]*f[1]+f[2]*f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='*') && (c[3]=='+')) {z=f[0]*f[1]*f[2]*f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='*') && (c[3]=='+')) {z=f[0]*f[1]/f[2]*f[3]+f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='*') && (c[3]=='+')) {z=f[0]/f[1]-f[2]*f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='*') && (c[3]=='+')) {z=f[0]/f[1]+f[2]*f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='*') && (c[3]=='+')) {z=f[0]/f[1]*f[2]*f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='*') && (c[3]=='+')) {z=f[0]/f[1]/f[2]*f[3]+f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='/') && (c[3]=='+')) {z=f[0]-f[1]-f[2]/f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='/') && (c[3]=='+')) {z=f[0]-f[1]+f[2]/f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='/') && (c[3]=='+')) {z=f[0]-f[1]*f[2]/f[3]+f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='/') && (c[3]=='+')) {z=f[0]-f[1]/f[2]/f[3]+f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='/') && (c[3]=='+')) {z=f[0]+f[1]-f[2]/f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='/') && (c[3]=='+')) {z=f[0]+f[1]+f[2]/f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='/') && (c[3]=='+')) {z=f[0]+f[1]*f[2]/f[3]+f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='/') && (c[3]=='+')) {z=f[0]+f[1]/f[2]/f[3]+f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='/') && (c[3]=='+')) {z=f[0]*f[1]-f[2]/f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='/') && (c[3]=='+')) {z=f[0]*f[1]+f[2]/f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='/') && (c[3]=='+')) {z=f[0]*f[1]*f[2]/f[3]+f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='/') && (c[3]=='+')) {z=f[0]*f[1]/f[2]/f[3]+f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='/') && (c[3]=='+')) {z=f[0]/f[1]-f[2]/f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='/') && (c[3]=='+')) {z=f[0]/f[1]+f[2]/f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='/') && (c[3]=='+')) {z=f[0]/f[1]*f[2]/f[3]+f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='/') && (c[3]=='+')) {z=f[0]/f[1]/f[2]/f[3]+f[4];}

 

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='-') && (c[3]=='-')) {z=f[0]-f[1]-f[2]-f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='-') && (c[3]=='-')) {z=f[0]-f[1]+f[2]-f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='-') && (c[3]=='-')) {z=f[0]-f[1]*f[2]-f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='-') && (c[3]=='-')) {z=f[0]-f[1]/f[2]-f[3]-f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='-') && (c[3]=='-')) {z=f[0]+f[1]-f[2]-f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='-') && (c[3]=='-')) {z=f[0]+f[1]+f[2]-f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='-') && (c[3]=='-')) {z=f[0]+f[1]*f[2]-f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='-') && (c[3]=='-')) {z=f[0]+f[1]/f[2]-f[3]-f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='-') && (c[3]=='-')) {z=f[0]*f[1]-f[2]-f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='-') && (c[3]=='-')) {z=f[0]*f[1]+f[2]-f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='-') && (c[3]=='-')) {z=f[0]*f[1]*f[2]-f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='-') && (c[3]=='-')) {z=f[0]*f[1]/f[2]-f[3]-f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='-') && (c[3]=='-')) {z=f[0]/f[1]-f[2]-f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='-') && (c[3]=='-')) {z=f[0]/f[1]+f[2]-f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='-') && (c[3]=='-')) {z=f[0]/f[1]*f[2]-f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='-') && (c[3]=='-')) {z=f[0]/f[1]/f[2]-f[3]-f[4];}

 

 

              if((c[0]=='-') && (c[1]=='-') && (c[2]=='+') && (c[3]=='-')) {z=f[0]-f[1]-f[2]+f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='+') && (c[3]=='-')) {z=f[0]-f[1]+f[2]+f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='+') && (c[3]=='-')) {z=f[0]-f[1]*f[2]+f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='+') && (c[3]=='-')) {z=f[0]-f[1]/f[2]+f[3]-f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='+') && (c[3]=='-')) {z=f[0]+f[1]-f[2]+f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='+') && (c[3]=='-')) {z=f[0]+f[1]+f[2]+f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='+') && (c[3]=='-')) {z=f[0]+f[1]*f[2]+f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='+') && (c[3]=='-')) {z=f[0]+f[1]/f[2]+f[3]-f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='+') && (c[3]=='-')) {z=f[0]*f[1]-f[2]+f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='+') && (c[3]=='-')) {z=f[0]*f[1]+f[2]+f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='+') && (c[3]=='-')) {z=f[0]*f[1]*f[2]+f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='+') && (c[3]=='-')) {z=f[0]*f[1]/f[2]+f[3]-f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='+') && (c[3]=='-')) {z=f[0]/f[1]-f[2]+f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='+') && (c[3]=='-')) {z=f[0]/f[1]+f[2]+f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='+') && (c[3]=='-')) {z=f[0]/f[1]*f[2]+f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='+') && (c[3]=='-')) {z=f[0]/f[1]/f[2]+f[3]-f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='*') && (c[3]=='-')) {z=f[0]-f[1]-f[2]*f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='*') && (c[3]=='-')) {z=f[0]-f[1]+f[2]*f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='*') && (c[3]=='-')) {z=f[0]-f[1]*f[2]*f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='*') && (c[3]=='-')) {z=f[0]-f[1]/f[2]*f[3]-f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='*') && (c[3]=='-')) {z=f[0]+f[1]-f[2]*f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='*') && (c[3]=='-')) {z=f[0]+f[1]+f[2]*f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='*') && (c[3]=='-')) {z=f[0]+f[1]*f[2]*f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='*') && (c[3]=='-')) {z=f[0]+f[1]/f[2]*f[3]-f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='*') && (c[3]=='-')) {z=f[0]*f[1]-f[2]*f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='*') && (c[3]=='-')) {z=f[0]*f[1]+f[2]*f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='*') && (c[3]=='-')) {z=f[0]*f[1]*f[2]*f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='*') && (c[3]=='-')) {z=f[0]*f[1]/f[2]*f[3]-f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='*') && (c[3]=='-')) {z=f[0]/f[1]-f[2]*f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='*') && (c[3]=='-')) {z=f[0]/f[1]+f[2]*f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='*') && (c[3]=='-')) {z=f[0]/f[1]*f[2]*f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='*') && (c[3]=='-')) {z=f[0]/f[1]/f[2]*f[3]-f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='/') && (c[3]=='-')) {z=f[0]-f[1]-f[2]/f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='/') && (c[3]=='-')) {z=f[0]-f[1]+f[2]/f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='/') && (c[3]=='-')) {z=f[0]-f[1]*f[2]/f[3]-f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='/') && (c[3]=='-')) {z=f[0]-f[1]/f[2]/f[3]-f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='/') && (c[3]=='-')) {z=f[0]+f[1]-f[2]/f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='/') && (c[3]=='-')) {z=f[0]+f[1]+f[2]/f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='/') && (c[3]=='-')) {z=f[0]+f[1]*f[2]/f[3]-f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='/') && (c[3]=='-')) {z=f[0]+f[1]/f[2]/f[3]-f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='/') && (c[3]=='-')) {z=f[0]*f[1]-f[2]/f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='/') && (c[3]=='-')) {z=f[0]*f[1]+f[2]/f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='/') && (c[3]=='-')) {z=f[0]*f[1]*f[2]/f[3]-f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='/') && (c[3]=='-')) {z=f[0]*f[1]/f[2]/f[3]-f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='/') && (c[3]=='-')) {z=f[0]/f[1]-f[2]/f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='/') && (c[3]=='-')) {z=f[0]/f[1]+f[2]/f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='/') && (c[3]=='-')) {z=f[0]/f[1]*f[2]/f[3]-f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='/') && (c[3]=='-')) {z=f[0]/f[1]/f[2]/f[3]-f[4];}

 

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='-') && (c[3]=='*')) {z=f[0]-f[1]-f[2]-f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='-') && (c[3]=='*')) {z=f[0]-f[1]+f[2]-f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='-') && (c[3]=='*')) {z=f[0]-f[1]*f[2]-f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='-') && (c[3]=='*')) {z=f[0]-f[1]/f[2]-f[3]*f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='-') && (c[3]=='*')) {z=f[0]+f[1]-f[2]-f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='-') && (c[3]=='*')) {z=f[0]+f[1]+f[2]-f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='-') && (c[3]=='*')) {z=f[0]+f[1]*f[2]-f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='-') && (c[3]=='*')) {z=f[0]+f[1]/f[2]-f[3]*f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='-') && (c[3]=='*')) {z=f[0]*f[1]-f[2]-f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='-') && (c[3]=='*')) {z=f[0]*f[1]+f[2]-f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='-') && (c[3]=='*')) {z=f[0]*f[1]*f[2]-f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='-') && (c[3]=='*')) {z=f[0]*f[1]/f[2]-f[3]*f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='-') && (c[3]=='*')) {z=f[0]/f[1]-f[2]-f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='-') && (c[3]=='*')) {z=f[0]/f[1]+f[2]-f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='-') && (c[3]=='*')) {z=f[0]/f[1]*f[2]-f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='-') && (c[3]=='*')) {z=f[0]/f[1]/f[2]-f[3]*f[4];}

 

 

              if((c[0]=='-') && (c[1]=='-') && (c[2]=='+') && (c[3]=='*')) {z=f[0]-f[1]-f[2]+f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='+') && (c[3]=='*')) {z=f[0]-f[1]+f[2]+f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='+') && (c[3]=='*')) {z=f[0]-f[1]*f[2]+f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='+') && (c[3]=='*')) {z=f[0]-f[1]/f[2]+f[3]*f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='+') && (c[3]=='*')) {z=f[0]+f[1]-f[2]+f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='+') && (c[3]=='*')) {z=f[0]+f[1]+f[2]+f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='+') && (c[3]=='*')) {z=f[0]+f[1]*f[2]+f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='+') && (c[3]=='*')) {z=f[0]+f[1]/f[2]+f[3]*f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='+') && (c[3]=='*')) {z=f[0]*f[1]-f[2]+f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='+') && (c[3]=='*')) {z=f[0]*f[1]+f[2]+f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='+') && (c[3]=='*')) {z=f[0]*f[1]*f[2]+f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='+') && (c[3]=='*')) {z=f[0]*f[1]/f[2]+f[3]*f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='+') && (c[3]=='*')) {z=f[0]/f[1]-f[2]+f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='+') && (c[3]=='*')) {z=f[0]/f[1]+f[2]+f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='+') && (c[3]=='*')) {z=f[0]/f[1]*f[2]+f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='+') && (c[3]=='*')) {z=f[0]/f[1]/f[2]+f[3]*f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='*') && (c[3]=='*')) {z=f[0]-f[1]-f[2]*f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='*') && (c[3]=='*')) {z=f[0]-f[1]+f[2]*f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='*') && (c[3]=='*')) {z=f[0]-f[1]*f[2]*f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='*') && (c[3]=='*')) {z=f[0]-f[1]/f[2]*f[3]*f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='*') && (c[3]=='*')) {z=f[0]+f[1]-f[2]*f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='*') && (c[3]=='*')) {z=f[0]+f[1]+f[2]*f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='*') && (c[3]=='*')) {z=f[0]+f[1]*f[2]*f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='*') && (c[3]=='*')) {z=f[0]+f[1]/f[2]*f[3]*f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='*') && (c[3]=='*')) {z=f[0]*f[1]-f[2]*f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='*') && (c[3]=='*')) {z=f[0]*f[1]+f[2]*f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='*') && (c[3]=='*')) {z=f[0]*f[1]*f[2]*f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='*') && (c[3]=='*')) {z=f[0]*f[1]/f[2]*f[3]*f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='*') && (c[3]=='*')) {z=f[0]/f[1]-f[2]*f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='*') && (c[3]=='*')) {z=f[0]/f[1]+f[2]*f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='*') && (c[3]=='*')) {z=f[0]/f[1]*f[2]*f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='*') && (c[3]=='*')) {z=f[0]/f[1]/f[2]*f[3]*f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='/') && (c[3]=='*')) {z=f[0]-f[1]-f[2]/f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='/') && (c[3]=='*')) {z=f[0]-f[1]+f[2]/f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='/') && (c[3]=='*')) {z=f[0]-f[1]*f[2]/f[3]*f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='/') && (c[3]=='*')) {z=f[0]-f[1]/f[2]/f[3]*f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='/') && (c[3]=='*')) {z=f[0]+f[1]-f[2]/f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='/') && (c[3]=='*')) {z=f[0]+f[1]+f[2]/f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='/') && (c[3]=='*')) {z=f[0]+f[1]*f[2]/f[3]*f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='/') && (c[3]=='*')) {z=f[0]+f[1]/f[2]/f[3]*f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='/') && (c[3]=='*')) {z=f[0]*f[1]-f[2]/f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='/') && (c[3]=='*')) {z=f[0]*f[1]+f[2]/f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='/') && (c[3]=='*')) {z=f[0]*f[1]*f[2]/f[3]*f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='/') && (c[3]=='*')) {z=f[0]*f[1]/f[2]/f[3]*f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='/') && (c[3]=='*')) {z=f[0]/f[1]-f[2]/f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='/') && (c[3]=='*')) {z=f[0]/f[1]+f[2]/f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='/') && (c[3]=='*')) {z=f[0]/f[1]*f[2]/f[3]*f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='/') && (c[3]=='*')) {z=f[0]/f[1]/f[2]/f[3]*f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='-') && (c[3]=='/')) {z=f[0]-f[1]-f[2]-f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='-') && (c[3]=='/')) {z=f[0]-f[1]+f[2]-f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='-') && (c[3]=='/')) {z=f[0]-f[1]*f[2]-f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='-') && (c[3]=='/')) {z=f[0]-f[1]/f[2]-f[3]/f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='-') && (c[3]=='/')) {z=f[0]+f[1]-f[2]-f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='-') && (c[3]=='/')) {z=f[0]+f[1]+f[2]-f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='-') && (c[3]=='/')) {z=f[0]+f[1]*f[2]-f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='-') && (c[3]=='/')) {z=f[0]+f[1]/f[2]-f[3]/f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='-') && (c[3]=='/')) {z=f[0]*f[1]-f[2]-f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='-') && (c[3]=='/')) {z=f[0]*f[1]+f[2]-f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='-') && (c[3]=='/')) {z=f[0]*f[1]*f[2]-f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='-') && (c[3]=='/')) {z=f[0]*f[1]/f[2]-f[3]/f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='-') && (c[3]=='/')) {z=f[0]/f[1]-f[2]-f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='-') && (c[3]=='/')) {z=f[0]/f[1]+f[2]-f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='-') && (c[3]=='/')) {z=f[0]/f[1]*f[2]-f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='-') && (c[3]=='/')) {z=f[0]/f[1]/f[2]-f[3]/f[4];}

 

 

              if((c[0]=='-') && (c[1]=='-') && (c[2]=='+') && (c[3]=='/')) {z=f[0]-f[1]-f[2]+f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='+') && (c[3]=='/')) {z=f[0]-f[1]+f[2]+f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='+') && (c[3]=='/')) {z=f[0]-f[1]*f[2]+f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='+') && (c[3]=='/')) {z=f[0]-f[1]/f[2]+f[3]/f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='+') && (c[3]=='/')) {z=f[0]+f[1]-f[2]+f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='+') && (c[3]=='/')) {z=f[0]+f[1]+f[2]+f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='+') && (c[3]=='/')) {z=f[0]+f[1]*f[2]+f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='+') && (c[3]=='/')) {z=f[0]+f[1]/f[2]+f[3]/f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='+') && (c[3]=='/')) {z=f[0]*f[1]-f[2]+f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='+') && (c[3]=='/')) {z=f[0]*f[1]+f[2]+f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='+') && (c[3]=='/')) {z=f[0]*f[1]*f[2]+f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='+') && (c[3]=='/')) {z=f[0]*f[1]/f[2]+f[3]/f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='+') && (c[3]=='/')) {z=f[0]/f[1]-f[2]+f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='+') && (c[3]=='/')) {z=f[0]/f[1]+f[2]+f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='+') && (c[3]=='/')) {z=f[0]/f[1]*f[2]+f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='+') && (c[3]=='/')) {z=f[0]/f[1]/f[2]+f[3]/f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='*') && (c[3]=='/')) {z=f[0]-f[1]-f[2]*f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='*') && (c[3]=='/')) {z=f[0]-f[1]+f[2]*f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='*') && (c[3]=='/')) {z=f[0]-f[1]*f[2]*f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='*') && (c[3]=='/')) {z=f[0]-f[1]/f[2]*f[3]/f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='*') && (c[3]=='/')) {z=f[0]+f[1]-f[2]*f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='*') && (c[3]=='/')) {z=f[0]+f[1]+f[2]*f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='*') && (c[3]=='/')) {z=f[0]+f[1]*f[2]*f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='*') && (c[3]=='/')) {z=f[0]+f[1]/f[2]*f[3]/f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='*') && (c[3]=='/')) {z=f[0]*f[1]-f[2]*f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='*') && (c[3]=='/')) {z=f[0]*f[1]+f[2]*f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='*') && (c[3]=='/')) {z=f[0]*f[1]*f[2]*f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='*') && (c[3]=='/')) {z=f[0]*f[1]/f[2]*f[3]/f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='*') && (c[3]=='/')) {z=f[0]/f[1]-f[2]*f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='*') && (c[3]=='/')) {z=f[0]/f[1]+f[2]*f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='*') && (c[3]=='/')) {z=f[0]/f[1]*f[2]*f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='*') && (c[3]=='/')) {z=f[0]/f[1]/f[2]*f[3]/f[4];}

 

 

                      if((c[0]=='-') && (c[1]=='-') && (c[2]=='/') && (c[3]=='/')) {z=f[0]-f[1]-f[2]/f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='+') && (c[2]=='/') && (c[3]=='/')) {z=f[0]-f[1]+f[2]/f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='*') && (c[2]=='/') && (c[3]=='/')) {z=f[0]-f[1]*f[2]/f[3]/f[4];}

                 else if((c[0]=='-') && (c[1]=='/') && (c[2]=='/') && (c[3]=='/')) {z=f[0]-f[1]/f[2]/f[3]/f[4];}

 

         else if((c[0]=='+') && (c[1]=='-') && (c[2]=='/') && (c[3]=='/')) {z=f[0]+f[1]-f[2]/f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='+') && (c[2]=='/') && (c[3]=='/')) {z=f[0]+f[1]+f[2]/f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='*') && (c[2]=='/') && (c[3]=='/')) {z=f[0]+f[1]*f[2]/f[3]/f[4];}

                 else if((c[0]=='+') && (c[1]=='/') && (c[2]=='/') && (c[3]=='/')) {z=f[0]+f[1]/f[2]/f[3]/f[4];}

 

                 else if((c[0]=='*') && (c[1]=='-') && (c[2]=='/') && (c[3]=='/')) {z=f[0]*f[1]-f[2]/f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='+') && (c[2]=='/') && (c[3]=='/')) {z=f[0]*f[1]+f[2]/f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='*') && (c[2]=='/') && (c[3]=='/')) {z=f[0]*f[1]*f[2]/f[3]/f[4];}

                 else if((c[0]=='*') && (c[1]=='/') && (c[2]=='/') && (c[3]=='/')) {z=f[0]*f[1]/f[2]/f[3]/f[4];}

 

                 else if((c[0]=='/') && (c[1]=='-') && (c[2]=='/') && (c[3]=='/')) {z=f[0]/f[1]-f[2]/f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='+') && (c[2]=='/') && (c[3]=='/')) {z=f[0]/f[1]+f[2]/f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='*') && (c[2]=='/') && (c[3]=='/')) {z=f[0]/f[1]*f[2]/f[3]/f[4];}

                 else if((c[0]=='/') && (c[1]=='/') && (c[2]=='/') && (c[3]=='/')) {z=f[0]/f[1]/f[2]/f[3]/f[4];}

 

         }

 

      if(kazu<5)

          {printf("calf() %s%19.18f",b,z);return(1);}

          else   {printf("calf()   OVER  !");return(0);}

         

      return(0);

}

 

 

 

 

int     zzzz(void)

{

 

       wprintf(L"zzzz()");

       return(1);

}

 

//このアプリケーションのエントリ ポイントです。


                     HOME
                  −−戻る 次へ++