Mercurial > hg > octave-nkf
changeset 2472:0c788e9b53b8
[project @ 1996-11-06 04:10:07 by jwe]
author | jwe |
---|---|
date | Wed, 06 Nov 1996 04:12:18 +0000 |
parents | 7f99808d467d |
children | bb0c213e5885 |
files | ChangeLog configure.in src/ChangeLog src/getpwent.cc src/syscalls.cc |
diffstat | 5 files changed, 74 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Tue Nov 5 12:32:30 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * configure.in: Add checks for geteuid, getuid. + * configure.in: Comment out code to handle --enable-readline since it doesn't work yet.
--- a/configure.in +++ b/configure.in @@ -20,7 +20,7 @@ ### along with Octave; see the file COPYING. If not, write to the Free ### Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -AC_REVISION($Revision: 1.225 $) +AC_REVISION($Revision: 1.227 $) AC_PREREQ(2.9) AC_INIT(src/octave.cc) AC_CONFIG_HEADER(config.h) @@ -179,7 +179,7 @@ READLINE_DIR=readline USE_READLINE=true LIBREADLINE=-lreadline -dnlAC_ARG_ENABLE(readline, +dnl AC_ARG_ENABLE(readline, dnl [ --enable-readline use readline library (default is yes)], dnl [if test "$enableval" = no; then dnl USE_READLINE=false; @@ -696,13 +696,13 @@ ### Checks for functions and variables. AC_CHECK_FUNCS(atexit bcopy bzero dup2 endpwent execvp fcntl fork \ - getcwd gethostname getpgrp getpid getppid getpwent \ - getpwnam getpwuid lstat memmove mkdir mkfifo on_exit \ - pipe putenv rename rindex rmdir setpwent setvbuf \ - sigaction sigpending sigprocmask sigsuspend stat \ - strcasecmp strdup strerror stricmp strncasecmp \ - strnicmp tempnam umask unlink vfprintf vsprintf \ - waitpid) + getcwd geteuid gethostname getpgrp getpid getppid \ + getpwent getpwnam getpwuid getuid lstat memmove mkdir \ + mkfifo on_exit pipe putenv rename rindex rmdir \ + setpwent setvbuf sigaction sigpending sigprocmask \ + sigsuspend stat strcasecmp strdup strerror stricmp \ + strncasecmp strnicmp tempnam umask unlink vfprintf \ + vsprintf waitpid) OCTAVE_SMART_PUTENV OCTAVE_PROGRAM_INVOCATION_NAME
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ Tue Nov 5 13:00:35 1996 John W. Eaton <jwe@bevo.che.wisc.edu> + * syscalls.cc (Fgeteuid, Fgetuid): New functions. + + * getpwent.cc: Use gripe_not_supported from gripes.cc, instead of + local gripe_not_implemented function. + * input.cc, sysdep.cc, variables.cc: Only include readline.h and history.h if USE_READLINE is defined.
--- a/src/getpwent.cc +++ b/src/getpwent.cc @@ -36,6 +36,7 @@ #include "defun-dld.h" #include "error.h" +#include "gripes.h" #include "help.h" #include "oct-map.h" #include "ov.h" @@ -69,16 +70,6 @@ return retval; } -#if ! (defined (HAVE_GETPWENT) || defined (HAVE_GETPWUID) \ - || defined (HAVE_GETPWNAM) || defined (HAVE_SETPWENT) \ - || defined (HAVE_ENDPWENT)) -static void -gripe_not_implemented (const char *nm) -{ - error ("%s: not implemented on this system", nm); -} -#endif - DEFUN_DLD (getpwent, , , "getpwent ()\n\ \n\ @@ -87,9 +78,14 @@ octave_value retval; #ifdef HAVE_GETPWENT - retval = mk_pw_map (getpwent ()); + int nargin = args.length (); + + if (nargin == 0) + retval = mk_pw_map (getpwent ()); + else + print_usage ("getpwent"); #else - gripe_not_implemented ("getpwent"); + gripe_not_supported ("getpwent"); #endif return retval; @@ -124,7 +120,7 @@ else print_usage ("getpwuid"); #else - gripe_not_implemented ("getpwuid"); + gripe_not_supported ("getpwuid"); #endif return retval; @@ -150,7 +146,7 @@ else print_usage ("getpwnam"); #else - gripe_not_implemented ("getpwnam"); + gripe_not_supported ("getpwnam"); #endif return retval; @@ -164,9 +160,14 @@ octave_value retval; #ifdef HAVE_SETPWENT - setpwent (); + int nargin = args.length (); + + if (nargin == 0) + setpwent (); + else + print_usage ("setpwent"); #else - gripe_not_implemented ("setpwent"); + gripe_not_supported ("setpwent"); #endif return retval; @@ -180,9 +181,14 @@ octave_value retval; #ifdef HAVE_ENDPWENT - endpwent (); + int nargin = args.length (); + + if (nargin == 0) + endpwent (); + else + print_usage ("endpwent"); #else - gripe_not_implemented ("endpwent"); + gripe_not_supported ("endpwent"); #endif return retval;
--- a/src/syscalls.cc +++ b/src/syscalls.cc @@ -309,6 +309,40 @@ return retval; } +DEFUN (geteuid, , , + "uid = geteuid (): return the effective user id of the current process") +{ + double retval = -1.0; + +#if defined (HAVE_GETEUID) + int nargin = args.length (); + + if (nargin == 0) + retval = geteuid (); + else + print_usage ("geteuid"); +#else + gripe_not_supported ("geteuid"); +#endif +} + +DEFUN (getuid, , , + "uid = getuid (): return the real user id of the current process") +{ + double retval = -1.0; + +#if defined (HAVE_GETUID) + int nargin = args.length (); + + if (nargin == 0) + retval = getuid (); + else + print_usage ("getuid"); +#else + gripe_not_supported ("getuid"); +#endif +} + DEFUN (lstat, args, , "[S, ERR, MSG] = lstat (NAME)\n\ \n\