[svn:parrot] r43274 - trunk/src/pmc
bacek at svn.parrot.org
bacek at svn.parrot.org
Mon Dec 28 12:15:48 UTC 2009
Author: bacek
Date: Mon Dec 28 12:15:47 2009
New Revision: 43274
URL: https://trac.parrot.org/parrot/changeset/43274
Log:
[cage] Use INTERP instead of interp in Os PMC
Modified:
trunk/src/pmc/os.pmc
Modified: trunk/src/pmc/os.pmc
==============================================================================
--- trunk/src/pmc/os.pmc Mon Dec 28 05:14:15 2009 (r43273)
+++ trunk/src/pmc/os.pmc Mon Dec 28 12:15:47 2009 (r43274)
@@ -85,13 +85,13 @@
# endif
#endif
if (cwd) {
- STRING * const scwd = Parrot_str_new(interp, cwd, strlen(cwd));
+ STRING * const scwd = Parrot_str_new(INTERP, cwd, strlen(cwd));
mem_sys_free(cwd);
RETURN(STRING *scwd);
}
else {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
}
@@ -108,7 +108,7 @@
METHOD chdir(STRING *path) {
int error;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
#ifdef _MSC_VER
error = _chdir(cpath);
#else
@@ -117,7 +117,7 @@
Parrot_str_free_cstring(cpath);
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
}
@@ -135,13 +135,13 @@
METHOD rm(STRING *path) {
struct stat info;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
int error = stat(cpath, &info);
if (error) {
const char * const errmsg = strerror(errno);
Parrot_str_free_cstring(cpath);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
@@ -154,7 +154,7 @@
Parrot_str_free_cstring(cpath);
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
}
@@ -163,7 +163,7 @@
Parrot_str_free_cstring(cpath);
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
}
@@ -180,7 +180,7 @@
*/
METHOD mkdir(STRING *path, INTVAL mode) {
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
/* should we validate mode? */
#ifdef WIN32
const int error = _mkdir(cpath);
@@ -190,7 +190,7 @@
Parrot_str_free_cstring(cpath);
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
}
@@ -226,46 +226,46 @@
METHOD stat(STRING *path) {
struct stat info;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
const int error = stat(cpath, &info);
Parrot_str_free_cstring(cpath);
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
else {
- PMC * const array = pmc_new(interp, enum_class_FixedPMCArray);
- VTABLE_set_integer_native(interp, array, 13);
+ PMC * const array = pmc_new(INTERP, enum_class_FixedPMCArray);
+ VTABLE_set_integer_native(INTERP, array, 13);
- VTABLE_set_integer_keyed_int(interp, array, 0,
+ VTABLE_set_integer_keyed_int(INTERP, array, 0,
(INTVAL)info.st_dev);
- VTABLE_set_integer_keyed_int(interp, array, 1,
+ VTABLE_set_integer_keyed_int(INTERP, array, 1,
(INTVAL)info.st_ino);
- VTABLE_set_integer_keyed_int(interp, array, 2,
+ VTABLE_set_integer_keyed_int(INTERP, array, 2,
(INTVAL)info.st_mode);
- VTABLE_set_integer_keyed_int(interp, array, 3,
+ VTABLE_set_integer_keyed_int(INTERP, array, 3,
(INTVAL)info.st_nlink);
- VTABLE_set_integer_keyed_int(interp, array, 4,
+ VTABLE_set_integer_keyed_int(INTERP, array, 4,
(INTVAL)info.st_uid);
- VTABLE_set_integer_keyed_int(interp, array, 5,
+ VTABLE_set_integer_keyed_int(INTERP, array, 5,
(INTVAL)info.st_gid);
- VTABLE_set_integer_keyed_int(interp, array, 6,
+ VTABLE_set_integer_keyed_int(INTERP, array, 6,
(INTVAL)info.st_rdev);
- VTABLE_set_integer_keyed_int(interp, array, 7,
+ VTABLE_set_integer_keyed_int(INTERP, array, 7,
(INTVAL)info.st_size);
- VTABLE_set_integer_keyed_int(interp, array, 8,
+ VTABLE_set_integer_keyed_int(INTERP, array, 8,
(INTVAL)info.st_atime);
- VTABLE_set_integer_keyed_int(interp, array, 9,
+ VTABLE_set_integer_keyed_int(INTERP, array, 9,
(INTVAL)info.st_mtime);
- VTABLE_set_integer_keyed_int(interp, array, 10,
+ VTABLE_set_integer_keyed_int(INTERP, array, 10,
(INTVAL)info.st_ctime);
#ifndef WIN32
- VTABLE_set_integer_keyed_int(interp, array, 11,
+ VTABLE_set_integer_keyed_int(INTERP, array, 11,
(INTVAL)info.st_blksize);
- VTABLE_set_integer_keyed_int(interp, array, 12,
+ VTABLE_set_integer_keyed_int(INTERP, array, 12,
(INTVAL)info.st_blocks);
#endif
RETURN(PMC *array);
@@ -301,7 +301,7 @@
METHOD lstat(STRING *path) {
struct stat info;
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
#ifdef WIN32
const int error = stat(cpath, &info);
#else
@@ -311,39 +311,39 @@
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
else {
- PMC * const array = pmc_new(interp, enum_class_FixedPMCArray);
- VTABLE_set_integer_native(interp, array, 13);
+ PMC * const array = pmc_new(INTERP, enum_class_FixedPMCArray);
+ VTABLE_set_integer_native(INTERP, array, 13);
- VTABLE_set_integer_keyed_int(interp, array, 0,
+ VTABLE_set_integer_keyed_int(INTERP, array, 0,
(INTVAL)info.st_dev);
- VTABLE_set_integer_keyed_int(interp, array, 1,
+ VTABLE_set_integer_keyed_int(INTERP, array, 1,
(INTVAL)info.st_ino);
- VTABLE_set_integer_keyed_int(interp, array, 2,
+ VTABLE_set_integer_keyed_int(INTERP, array, 2,
(INTVAL)info.st_mode);
- VTABLE_set_integer_keyed_int(interp, array, 3,
+ VTABLE_set_integer_keyed_int(INTERP, array, 3,
(INTVAL)info.st_nlink);
- VTABLE_set_integer_keyed_int(interp, array, 4,
+ VTABLE_set_integer_keyed_int(INTERP, array, 4,
(INTVAL)info.st_uid);
- VTABLE_set_integer_keyed_int(interp, array, 5,
+ VTABLE_set_integer_keyed_int(INTERP, array, 5,
(INTVAL)info.st_gid);
- VTABLE_set_integer_keyed_int(interp, array, 6,
+ VTABLE_set_integer_keyed_int(INTERP, array, 6,
(INTVAL)info.st_rdev);
- VTABLE_set_integer_keyed_int(interp, array, 7,
+ VTABLE_set_integer_keyed_int(INTERP, array, 7,
(INTVAL)info.st_size);
- VTABLE_set_integer_keyed_int(interp, array, 8,
+ VTABLE_set_integer_keyed_int(INTERP, array, 8,
(INTVAL)info.st_atime);
- VTABLE_set_integer_keyed_int(interp, array, 9,
+ VTABLE_set_integer_keyed_int(INTERP, array, 9,
(INTVAL)info.st_mtime);
- VTABLE_set_integer_keyed_int(interp, array, 10,
+ VTABLE_set_integer_keyed_int(INTERP, array, 10,
(INTVAL)info.st_ctime);
#ifndef WIN32
- VTABLE_set_integer_keyed_int(interp, array, 11,
+ VTABLE_set_integer_keyed_int(INTERP, array, 11,
(INTVAL)info.st_blksize);
- VTABLE_set_integer_keyed_int(interp, array, 12,
+ VTABLE_set_integer_keyed_int(INTERP, array, 12,
(INTVAL)info.st_blocks);
#endif
RETURN(PMC *array);
@@ -362,8 +362,8 @@
METHOD symlink(STRING *from, STRING *to) {
#ifndef WIN32
- char * const cfrom = Parrot_str_to_cstring(interp, from);
- char * const cto = Parrot_str_to_cstring(interp, to);
+ char * const cfrom = Parrot_str_to_cstring(INTERP, from);
+ char * const cto = Parrot_str_to_cstring(INTERP, to);
const int error = symlink(cfrom, cto);
Parrot_str_free_cstring(cfrom);
@@ -371,11 +371,11 @@
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
#else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_UNIMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_UNIMPLEMENTED,
"Win32 does not support symlinks!");
#endif
}
@@ -392,8 +392,8 @@
METHOD link(STRING *from, STRING *to) {
#ifndef WIN32
- char * const cfrom = Parrot_str_to_cstring(interp, from);
- char * const cto = Parrot_str_to_cstring(interp, to);
+ char * const cfrom = Parrot_str_to_cstring(INTERP, from);
+ char * const cto = Parrot_str_to_cstring(INTERP, to);
const int error = link(cfrom, cto);
Parrot_str_free_cstring(cfrom);
@@ -401,11 +401,11 @@
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
"link() failed for OS PMC: %s\n", errmsg);
}
#else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"Win32 is not POSIX. Need win32 developer!");
#endif
}
@@ -426,7 +426,7 @@
const INTVAL old = umask((mode_t)mask);
RETURN(INTVAL old);
#else
- Parrot_ex_throw_from_c_args(interp, NULL,
+ Parrot_ex_throw_from_c_args(INTERP, NULL,
EXCEPTION_UNIMPLEMENTED,
"Win32 is not POSIX. Need Win32 developer!");
#endif
@@ -448,18 +448,18 @@
METHOD chroot(STRING *path) {
#ifndef WIN32
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
const int error = chroot(cpath);
Parrot_str_free_cstring(cpath);
if (error) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
#else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"Win32 is not POSIX. Need Win32 developer!");
#endif
}
@@ -476,7 +476,7 @@
*/
METHOD readdir(STRING *path) {
#ifndef _MSC_VER
- char * const cpath = Parrot_str_to_cstring(interp, path);
+ char * const cpath = Parrot_str_to_cstring(INTERP, path);
DIR *dir = opendir(cpath);
struct dirent *dirent;
PMC *array;
@@ -486,22 +486,22 @@
if (!dir) {
const char * const errmsg = strerror(errno);
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
errmsg);
}
- array = pmc_new(interp, enum_class_ResizableStringArray);
+ array = pmc_new(INTERP, enum_class_ResizableStringArray);
while ((dirent = readdir(dir)) != NULL) {
- retval = Parrot_str_new(interp, dirent->d_name, 0) ;
- VTABLE_push_string(interp, array, retval);
+ retval = Parrot_str_new(INTERP, dirent->d_name, 0) ;
+ VTABLE_push_string(INTERP, array, retval);
}
closedir(dir);
RETURN(PMC *array);
#else
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_INTERNAL_NOT_IMPLEMENTED,
"Win32 is not POSIX. Need Win32 developer!");
#endif
}
@@ -515,8 +515,8 @@
*/
METHOD rename(STRING *oldpath, STRING *newpath) {
- char * const coldpath = Parrot_str_to_cstring(interp, oldpath);
- char * const cnewpath = Parrot_str_to_cstring(interp, newpath);
+ char * const coldpath = Parrot_str_to_cstring(INTERP, oldpath);
+ char * const cnewpath = Parrot_str_to_cstring(INTERP, newpath);
const int ret = rename(coldpath, cnewpath);
Parrot_str_free_cstring(coldpath);
@@ -524,7 +524,7 @@
if (ret < 0) {
const char * const errmsg = strerror(errno) ;
- Parrot_ex_throw_from_c_args(interp, NULL, EXCEPTION_EXTERNAL_ERROR,
+ Parrot_ex_throw_from_c_args(INTERP, NULL, EXCEPTION_EXTERNAL_ERROR,
"%s", errmsg);
}
}
More information about the parrot-commits
mailing list