Move various primitives from prosenv.c to pruxenv.c and prdosenv.c .
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 21 Oct 1992 00:02:44 +0000 (00:02 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Wed, 21 Oct 1992 00:02:44 +0000 (00:02 +0000)
v7/src/microcode/dosenv.c
v7/src/microcode/osenv.h
v7/src/microcode/prdosenv.c
v7/src/microcode/prosenv.c
v7/src/microcode/pruxenv.c

index a9f47529e3b77d893d7509be9c0d13b7232a1ec1..b26d926088ea6c99f72bde5a2eaa73892922ce26 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/Attic/dosenv.c,v 1.1 1992/05/05 06:55:13 jinx Exp $
+$Id: dosenv.c,v 1.2 1992/10/21 00:02:44 jinx Exp $
 
 Copyright (c) 1992 Massachusetts Institute of Technology
 
@@ -197,21 +197,3 @@ DEFUN (OS_set_working_dir_pathname, (name), char * name)
     }
   }
 }
-
-CONST char *
-DEFUN (OS_get_environment_variable, (name), CONST char * name)
-{
-  return (DOS_getenv (name));
-}
-
-CONST char *
-DEFUN_VOID (OS_current_user_name)
-{
-  return ("dos");
-}
-
-CONST char *
-DEFUN_VOID (OS_current_user_home_directory)
-{
-  return ("c:\\");
-}
index 6f70ebbd1fed84a388ca19433329b4f2f8b2741f..b202fc5477aa23858cb66d2d2b87ae7e367b37d5 100644 (file)
@@ -1,8 +1,8 @@
 /* -*-C-*-
 
-$Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/microcode/osenv.h,v 1.1 1990/06/20 19:36:16 cph Rel $
+$Id: osenv.h,v 1.2 1992/10/20 23:57:09 jinx Exp $
 
-Copyright (c) 1990 Massachusetts Institute of Technology
+Copyright (c) 1990-1992 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -57,8 +57,5 @@ extern void EXFUN (OS_real_timer_set, (clock_t first, clock_t interval));
 extern void EXFUN (OS_real_timer_clear, (void));
 extern CONST char * EXFUN (OS_working_dir_pathname, (void));
 extern void EXFUN (OS_set_working_dir_pathname, (CONST char * name));
-extern CONST char * EXFUN (OS_get_environment_variable, (CONST char * name));
-extern CONST char * EXFUN (OS_current_user_name, (void));
-extern CONST char * EXFUN (OS_current_user_home_directory, (void));
 
 #endif /* SCM_OSENV_H */
index 7cf27f2061f9884a58030eade7591ccbe34264d0..13410e276113ba94b81ab444c594bf3add29fbe8 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: prdosenv.c,v 1.7 1992/10/02 01:48:18 jinx Exp $
+$Id: prdosenv.c,v 1.8 1992/10/21 00:00:37 jinx Exp $
 
 Copyright (c) 1992 Massachusetts Institute of Technology
 
@@ -140,3 +140,21 @@ Wait until the command terminates, returning its exit status as an integer.")
     error_external_return ();
   PRIMITIVE_RETURN (long_to_integer ((long) result));
 }
+\f
+DEFINE_PRIMITIVE ("GET-ENVIRONMENT-VARIABLE", Prim_get_environment_variable, 1, 1,
+  "Look up the value of a variable in the user's shell environment.\n\
+The argument, a variable name, must be a string.\n\
+The result is either a string (the variable's value),\n\
+ or #F indicating that the variable does not exist.")
+{
+  extern CONST char * EXFUN (OS_get_environment_variable, (CONST char * name));
+  PRIMITIVE_HEADER (1);
+  {
+    CONST char * variable_value =
+      (OS_get_environment_variable (STRING_ARG (1)));
+    PRIMITIVE_RETURN
+      ((variable_value == 0)
+       ? SHARP_F
+       : (char_pointer_to_string ((unsigned char *) variable_value)));
+  }
+}
index 7272cb83ee31b8c223d690e17cc64dc099ddc3e0..f7610f5a435718766bee4f6bd2942b22ebde0c81 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: prosenv.c,v 1.6 1992/09/18 16:55:10 jinx Exp $
+$Id: prosenv.c,v 1.7 1992/10/20 23:59:33 jinx Exp $
 
 Copyright (c) 1987-1992 Massachusetts Institute of Technology
 
@@ -185,40 +185,6 @@ DEFINE_PRIMITIVE ("SET-WORKING-DIRECTORY-PATHNAME!", Prim_set_working_dir_pathna
   PRIMITIVE_RETURN (UNSPECIFIC);
 }
 
-DEFINE_PRIMITIVE ("GET-ENVIRONMENT-VARIABLE", Prim_get_environment_variable, 1, 1,
-  "Look up the value of a variable in the user's shell environment.\n\
-The argument, a variable name, must be a string.\n\
-The result is either a string (the variable's value),\n\
- or #F indicating that the variable does not exist.")
-{
-  PRIMITIVE_HEADER (1);
-  {
-    CONST char * variable_value =
-      (OS_get_environment_variable (STRING_ARG (1)));
-    PRIMITIVE_RETURN
-      ((variable_value == 0)
-       ? SHARP_F
-       : (char_pointer_to_string ((unsigned char *) variable_value)));
-  }
-}
-
-DEFINE_PRIMITIVE ("CURRENT-USER-NAME", Prim_current_user_name, 0, 0,
-  "Return (as a string) the user name of the user running Scheme.")
-{
-  PRIMITIVE_HEADER (0);
-  PRIMITIVE_RETURN (char_pointer_to_string
-                   ((unsigned char *) OS_current_user_name ()));
-}
-
-DEFINE_PRIMITIVE ("CURRENT-USER-HOME-DIRECTORY", Prim_current_user_home_directory, 0, 0,
-  "Return the name of the current user's home directory.")
-{
-  PRIMITIVE_HEADER (0);
-  PRIMITIVE_RETURN
-    (char_pointer_to_string ((unsigned char *)
-                            OS_current_user_home_directory ()));
-}
-
 DEFINE_PRIMITIVE ("SYSTEM-CALL-ERROR-MESSAGE", Prim_system_call_error_message, 1, 1, 0)
 {
   PRIMITIVE_HEADER (1);
index a3dbcf048d74e7a8bcc5d76d9a06646ce036e7e8..08465791f6cf498f7138dc61ccbc70ddbd4cf4ee 100644 (file)
@@ -1,6 +1,6 @@
 /* -*-C-*-
 
-$Id: pruxenv.c,v 1.11 1992/08/29 13:13:12 jinx Exp $
+$Id: pruxenv.c,v 1.12 1992/10/20 23:59:27 jinx Exp $
 
 Copyright (c) 1990-1992 Massachusetts Institute of Technology
 
@@ -107,7 +107,7 @@ If the argument is not a known group ID, #F is returned.")
        : (char_pointer_to_string ((unsigned char *) (entry -> gr_name))));
   }
 }
-
+\f
 DEFINE_PRIMITIVE ("CURRENT-UID", Prim_current_uid, 0, 0,
   "Return Scheme's effective UID.")
 {
@@ -135,6 +135,25 @@ DEFINE_PRIMITIVE ("REAL-GID", Prim_real_gid, 0, 0,
   PRIMITIVE_HEADER (0);
   PRIMITIVE_RETURN (long_to_integer (UX_getgid ()));
 }
+
+DEFINE_PRIMITIVE ("CURRENT-USER-NAME", Prim_current_user_name, 0, 0,
+  "Return (as a string) the user name of the user running Scheme.")
+{
+  extern CONST char * EXFUN (OS_current_user_name, (void));
+  PRIMITIVE_HEADER (0);
+  PRIMITIVE_RETURN (char_pointer_to_string
+                   ((unsigned char *) OS_current_user_name ()));
+}
+
+DEFINE_PRIMITIVE ("CURRENT-USER-HOME-DIRECTORY", Prim_current_user_home_directory, 0, 0,
+  "Return the name of the current user's home directory.")
+{
+  extern CONST char * EXFUN (OS_current_user_home_directory, (void));
+  PRIMITIVE_HEADER (0);
+  PRIMITIVE_RETURN
+    (char_pointer_to_string ((unsigned char *)
+                            OS_current_user_home_directory ()));
+}
 \f
 DEFINE_PRIMITIVE ("SYSTEM", Prim_system, 1, 1,
   "Invoke sh (the Bourne shell) on the string argument.\n\
@@ -165,6 +184,24 @@ DEFINE_PRIMITIVE ("UNIX-ENVIRONMENT", Prim_unix_environment_alist, 0, 0,
   }
 }
 
+DEFINE_PRIMITIVE ("GET-ENVIRONMENT-VARIABLE", Prim_get_environment_variable, 1, 1,
+  "Look up the value of a variable in the user's shell environment.\n\
+The argument, a variable name, must be a string.\n\
+The result is either a string (the variable's value),\n\
+ or #F indicating that the variable does not exist.")
+{
+  extern CONST char * EXFUN (OS_get_environment_variable, (CONST char * name));
+  PRIMITIVE_HEADER (1);
+  {
+    CONST char * variable_value =
+      (OS_get_environment_variable (STRING_ARG (1)));
+    PRIMITIVE_RETURN
+      ((variable_value == 0)
+       ? SHARP_F
+       : (char_pointer_to_string ((unsigned char *) variable_value)));
+  }
+}
+\f
 #define HOSTNAMESIZE 1024
 
 DEFINE_PRIMITIVE ("FULL-HOSTNAME", Prim_full_hostname, 0, 0,