/* -*-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
}
}
}
-
-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:\\");
-}
/* -*-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
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 */
/* -*-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
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)));
+ }
+}
/* -*-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
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);
/* -*-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
: (char_pointer_to_string ((unsigned char *) (entry -> gr_name))));
}
}
-
+\f
DEFINE_PRIMITIVE ("CURRENT-UID", Prim_current_uid, 0, 0,
"Return Scheme's effective UID.")
{
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\
}
}
+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,