Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions tdishr/TdiIo.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,27 @@ int Tdi1Fclose(opcode_t opcode __attribute__((unused)),
return TdiPutLong((int *)&err, out_ptr);
}

mdsdsc_t * Tdi3SeekSet()
{
static const int value = SEEK_SET;
static const mdsdsc_t constant = { sizeof(value), DTYPE_L, CLASS_S, (char *)&value };
return (mdsdsc_t *)&constant;
}

mdsdsc_t * Tdi3SeekCur()
{
static const int value = SEEK_CUR;
static const mdsdsc_t constant = { sizeof(value), DTYPE_L, CLASS_S, (char *)&value };
return (mdsdsc_t *)&constant;
}

mdsdsc_t * Tdi3SeekEnd()
{
static const int value = SEEK_END;
static const mdsdsc_t constant = { sizeof(value), DTYPE_L, CLASS_S, (char *)&value };
return (mdsdsc_t *)&constant;
}

/*----------------------------------------------
Specify position of file pointer.
err = FSEEK(unit, offset, origin)
Expand Down
3 changes: 3 additions & 0 deletions tdishr/opcodes.csv
Original file line number Diff line number Diff line change
Expand Up @@ -460,3 +460,6 @@
"458","List","LIST","List","undef","undef","XX","YY","XX","YY","0","254","OK+I+S","%f9+ [a..z1:z2:dz..n@[this]]"
"459","Squeeze","SQUEEZE","Reshape","undef","undef","XX","YY","XX","YY","1","2","OK","%f9+ squeeze(array, [min ndim]) "
"460","Flatten","FLATTEN","Reshape","undef","undef","XX","YY","XX","YY","1","1","OK","%f9+ flatten(array) "
"461","SeekSet","$SEEK_SET","Constant","undef","SeekSet","VV","VV","VV","VV","0","0","CONST","SEEK_SET"
"462","SeekCur","$SEEK_CUR","Constant","undef","SeekCur","VV","VV","VV","VV","0","0","CONST","SEEK_CUR"
"463","SeekEnd","$SEEK_END","Constant","undef","SeekEnd","VV","VV","VV","VV","0","0","CONST","SEEK_END"