[pypy-svn] r33017 - in pypy/dist/pypy/translator/cli: . src
antocuni at codespeak.net
antocuni at codespeak.net
Sun Oct 8 22:15:42 CEST 2006
Author: antocuni
Date: Sun Oct 8 22:15:37 2006
New Revision: 33017
Modified:
pypy/dist/pypy/translator/cli/database.py
pypy/dist/pypy/translator/cli/src/ll_os.cs
pypy/dist/pypy/translator/cli/src/pypylib.cs
Log:
Implemented ll_time_sleep.
Inserted a lot of stubs for not yet implemented ll_os functions.
Modified: pypy/dist/pypy/translator/cli/database.py
==============================================================================
--- pypy/dist/pypy/translator/cli/database.py (original)
+++ pypy/dist/pypy/translator/cli/database.py Sun Oct 8 22:15:37 2006
@@ -27,6 +27,9 @@
BUILTIN_RECORDS = {
+ ootype.Record({"item0": ootype.Signed, "item1": ootype.Signed}):
+ '[pypylib]pypy.runtime.Record_Signed_Signed',
+
ootype.Record({"item0": ootype.Float, "item1": ootype.Signed}):
'[pypylib]pypy.runtime.Record_Float_Signed',
Modified: pypy/dist/pypy/translator/cli/src/ll_os.cs
==============================================================================
--- pypy/dist/pypy/translator/cli/src/ll_os.cs (original)
+++ pypy/dist/pypy/translator/cli/src/ll_os.cs Sun Oct 8 22:15:37 2006
@@ -322,5 +322,129 @@
{
return "error " + errno; // TODO
}
+
+ public static void ll_os__exit(int x)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_chdir(string s)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_chmod(string s, int x)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_closedir(object o)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_dup(int x)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_dup2(int x, int y)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static int ll_os_fork()
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return -1;
+ }
+
+ public static void ll_os_ftruncate(int x, int y)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static int ll_os_getpid()
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return -1;
+ }
+
+ public static bool ll_os_isatty(int x)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return false;
+ }
+
+ public static void ll_os_link(string s1, string s2)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_mkdir(string s, int x)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static object ll_os_opendir(string s)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return null;
+ }
+
+ public static Record_Signed_Signed ll_os_pipe()
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return null;
+ }
+
+ public static void ll_os_putenv(string s)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static string ll_os_readdir(object o)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return null;
+ }
+
+ public static string ll_os_readlink(string s)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return null;
+ }
+
+ public static void ll_os_rename(string s1, string s2)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_rmdir(string s)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static void ll_os_symlink(string s1, string s2)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static int ll_os_system(string s)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return -1;
+ }
+
+ public static void ll_os_unsetenv(string s)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ }
+
+ public static Record_Signed_Signed ll_os_waitpid(int x, int y)
+ {
+ Helpers.raise_OSError(Errno.EPERM); // this is only a stub
+ return null;
+ }
}
}
Modified: pypy/dist/pypy/translator/cli/src/pypylib.cs
==============================================================================
--- pypy/dist/pypy/translator/cli/src/pypylib.cs (original)
+++ pypy/dist/pypy/translator/cli/src/pypylib.cs Sun Oct 8 22:15:37 2006
@@ -478,6 +478,18 @@
public TValue ll_current_value() { return it.Current.Value; }
}
+ public class Record_Signed_Signed {
+ public int item0;
+ public int item1;
+ public override string ToString() { return string.Format("({0}, {1},)", item0, item1); }
+ public override bool Equals(object obj)
+ {
+ Record_Signed_Signed x = (Record_Signed_Signed)obj;
+ return item0 == x.item0 && item1 == x.item1;
+ }
+ public override int GetHashCode() { return item0.GetHashCode(); }
+ }
+
public class Record_Float_Signed {
public double item0;
public int item1;
@@ -548,5 +560,10 @@
{
return (DateTime.UtcNow - ClockStart).TotalSeconds;
}
+
+ public static void ll_time_sleep(double seconds)
+ {
+ System.Threading.Thread.Sleep((int)(seconds*1000));
+ }
}
}
More information about the Pypy-commit
mailing list