diff options
author | Derrell Lipman <derrell@samba.org> | 2006-09-26 16:58:27 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:20:21 -0500 |
commit | 77e8402dd68079c0e245fc8826daf2c6ad334766 (patch) | |
tree | 64f65c7d3fb7f3aa970311f70e3f8bae4c0fc40c /source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFile.c | |
parent | 06de0f0b743056ba845de000339d4c3beb7cb845 (diff) | |
download | samba-77e8402dd68079c0e245fc8826daf2c6ad334766.tar.gz samba-77e8402dd68079c0e245fc8826daf2c6ad334766.tar.bz2 samba-77e8402dd68079c0e245fc8826daf2c6ad334766.zip |
r18925: Add current snapshot of the ejs-2.0 code. Tridge, will you be incorporating this?
(This used to be commit 917af234a8d517f82bd42256a940608a16b988f4)
Diffstat (limited to 'source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFile.c')
-rw-r--r-- | source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFile.c | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFile.c b/source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFile.c new file mode 100644 index 0000000000..24c521891e --- /dev/null +++ b/source4/lib/appweb/ejs-2.0/ejs/system/WIN/ejsFile.c @@ -0,0 +1,98 @@ +/* + * @file ejsFile.c + * @brief File class for the EJScript System Object Model + */ +/********************************** Copyright *********************************/ +/* + * Copyright (c) Mbedthis Software LLC, 2003-2006. All Rights Reserved. + */ +/********************************** Includes **********************************/ + +#include "ejs.h" + +/******************************************************************************/ +/* + * Default Constructor + */ + +/******************************************************************************/ +/************************************ Methods *********************************/ +/******************************************************************************/ +/* + * function open(); + */ + +static int openProc(Ejs *ep, EjsVar *thisObj, int argc, EjsVar **argv) +{ + ejsTrace(ep, "File.open()\n"); + return 0; +} + +/******************************************************************************/ +/* + * function close(); + */ + +static int closeProc(Ejs *ep, EjsVar *thisObj, int argc, EjsVar **argv) +{ + ejsTrace(ep, "File.close()\n"); + return 0; +} + +/******************************************************************************/ +/* + * function read(); + */ + +static int readProc(Ejs *ep, EjsVar *thisObj, int argc, EjsVar **argv) +{ + ejsTrace(ep, "File.read()\n"); + return 0; +} + +/******************************************************************************/ +/* + * function write(); + */ + +static int writeProc(Ejs *ep, EjsVar *thisObj, int argc, EjsVar **argv) +{ + ejsTrace(ep, "File.write()\n"); + return 0; +} + +/******************************************************************************/ +/******************************** Initialization ******************************/ +/******************************************************************************/ + +int ejsDefineFileClass(Ejs *ep) +{ + EjsVar *fileClass; + + fileClass = ejsDefineClass(ep, "File", "Object", 0); + if (fileClass == 0) { + return MPR_ERR_CANT_INITIALIZE; + } + + /* + * Define the methods + */ + ejsDefineCMethod(ep, fileClass, "open", openProc, 0); + ejsDefineCMethod(ep, fileClass, "close", closeProc, 0); + ejsDefineCMethod(ep, fileClass, "read", readProc, 0); + ejsDefineCMethod(ep, fileClass, "write", writeProc, 0); + + return ejsObjHasErrors(fileClass) ? MPR_ERR_CANT_INITIALIZE: 0; +} + +/******************************************************************************/ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim:tw=78 + * vim600: sw=4 ts=4 fdm=marker + * vim<600: sw=4 ts=4 + */ |