From 15f979c966ad8ea11e62f58a0f77ea52ffe8c48f Mon Sep 17 00:00:00 2001 From: Steve Bennett Date: Wed, 13 Oct 2010 21:31:08 +1000 Subject: Add aio '$handle filename' Retrieves the original filename Signed-off-by: Steve Bennett --- jim-aio.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'jim-aio.c') diff --git a/jim-aio.c b/jim-aio.c index 40daded..21a16d2 100644 --- a/jim-aio.c +++ b/jim-aio.c @@ -632,6 +632,14 @@ static int aio_cmd_tell(Jim_Interp *interp, int argc, Jim_Obj *const *argv) return JIM_OK; } +static int aio_cmd_filename(Jim_Interp *interp, int argc, Jim_Obj *const *argv) +{ + AioFile *af = Jim_CmdPrivData(interp); + + Jim_SetResult(interp, af->filename); + return JIM_OK; +} + #ifdef O_NDELAY static int aio_cmd_ndelay(Jim_Interp *interp, int argc, Jim_Obj *const *argv) { @@ -798,6 +806,10 @@ static const jim_subcmd_type aio_command_table[] = { .function = aio_cmd_tell, .description = "Returns the current seek position" }, + { .cmd = "filename", + .function = aio_cmd_filename, + .description = "Returns the original filename" + }, #ifdef O_NDELAY { .cmd = "ndelay", .args = "?0|1?", -- cgit v1.1