This commit is contained in:
@ -97,35 +97,35 @@ static int handle_args (int argc, ase_char_t* argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct xin_t
|
||||
typedef struct xin_t
|
||||
{
|
||||
const ase_char_t* name;
|
||||
ASE_FILE* fp;
|
||||
};
|
||||
} xin_t;
|
||||
|
||||
struct xout_t
|
||||
typedef struct xout_t
|
||||
{
|
||||
const ase_char_t* name;
|
||||
ASE_FILE* fp;
|
||||
};
|
||||
} xout_t;
|
||||
|
||||
|
||||
static int io_1 (ase_tgp_t* tgp, int cmd, ase_char_t* buf, int len)
|
||||
static int io_1 (int cmd, void* arg, ase_char_t* buf, int len)
|
||||
{
|
||||
xin_t* xin = (xin_t*)arg;
|
||||
|
||||
switch (cmd)
|
||||
{
|
||||
case ASE_IO_OPEN:
|
||||
case ASE_TGP_IO_OPEN:
|
||||
xin->fp = ase_fopen (ASE_T("abc.tgp"), ASE_T("r"));
|
||||
return (xin->fp == NULL) -1: 0;
|
||||
return (xin->fp == NULL)? -1: 0;
|
||||
|
||||
case ASE_IO_CLOSE
|
||||
case ASE_TGP_IO_CLOSE:
|
||||
ase_fclose (xin->fp);
|
||||
return 0;
|
||||
|
||||
case ASE_IO_READ:
|
||||
ase_fgets (xin->fp);
|
||||
case ASE_TGP_IO_READ:
|
||||
//ase_fgets (xin->fp);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -151,8 +151,8 @@ int tgp_main (int argc, ase_char_t* argv[])
|
||||
return -1;
|
||||
}
|
||||
|
||||
ase_tgp_setstdin (tgp, io, xin);
|
||||
ase_tgp_setstdout (tgp, io, ASE_NULL);
|
||||
//ase_tgp_setstdin (tgp, io, xin);
|
||||
//ase_tgp_setstdout (tgp, io, ASE_NULL);
|
||||
/*
|
||||
ase_tgp_setexecin (tgp, io, );
|
||||
ase_tgp_setexecout (tgp, io, );
|
||||
|
Reference in New Issue
Block a user