[Commit] nickle/builtin file.c,1.11,1.12
Keith Packard
commit at keithp.com
Thu Jun 26 02:59:12 PDT 2003
- Previous message: [Commit]
nickle file.c,1.49,1.50 nickle.h,1.103,1.104 value.h,1.86,1.87
- Next message: [Commit]
rrserver dispatch.5c,1.26,1.27 games.5c,1.24,1.25 main.5c,1.3,1.4
protocol,1.29,1.30
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Committed by: keithp
Update of /local/src/CVS/nickle/builtin
In directory home.keithp.com:/tmp/cvs-serv4289/builtin
Modified Files:
file.c
Log Message:
Add File::reopen
Index: file.c
===================================================================
RCS file: /local/src/CVS/nickle/builtin/file.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- file.c 29 May 2003 18:36:35 -0000 1.11
+++ file.c 26 Jun 2003 08:59:10 -0000 1.12
@@ -61,6 +61,7 @@
static const struct fbuiltin_3 funcs_3[] = {
{ do_File_pipe, "pipe", "f", "sA*ss" },
+ { do_File_reopen, "reopen", "f", "ssf" },
{ 0 }
};
@@ -223,6 +224,30 @@
FileGetErrorMessage (err),
2, FileGetError (err), file);
ret = Void;
+ }
+ complete = True;
+ RETURN (ret);
+}
+
+Value
+do_File_reopen (Value name, Value mode, Value file)
+{
+ ENTER ();
+ char *n, *m;
+ Value ret;
+ int err;
+
+ n = StringChars (&name->string);
+ m = StringChars (&mode->string);
+ if (aborting)
+ RETURN (Void);
+ ret = FileReopen (n, m, file, &err);
+ if (!ret)
+ {
+ RaiseStandardException (exception_open_error,
+ FileGetErrorMessage (err),
+ 2, FileGetError (err), name);
+ RETURN (Void);
}
complete = True;
RETURN (ret);
- Previous message: [Commit]
nickle file.c,1.49,1.50 nickle.h,1.103,1.104 value.h,1.86,1.87
- Next message: [Commit]
rrserver dispatch.5c,1.26,1.27 games.5c,1.24,1.25 main.5c,1.3,1.4
protocol,1.29,1.30
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commit
mailing list