octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: MacOSX: ismac() implementation


From: Thomas Treichl
Subject: Re: MacOSX: ismac() implementation
Date: Sun, 02 Sep 2007 13:25:13 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

Thomas Treichl schrieb:
Jordi Gutiérrez Hermoso schrieb:
On 01/09/07, Thomas Treichl <address@hidden> wrote:
  if (regexp (vhost, '(.+)-apple-darwin(.+)'))

Not that I want to start a discussion here, but just curious: will
this regexp also match a GNU/Darwin system? Could that conceivably be
a problem?

- Jordi G. H.

So just checking for Darwin without Apple would make more sense, right ;) This also makes me thinking about that we should keep isunix() for Mac and take a higher level implementation for ismac(), what would you say Jordi?

  Thomas

Sorry for answering my own email but I once again thought about ismac() and I think that this thread isn't worth being discussed because the solution is found on the Mac site where it says 'Based on Unix':

  http://www.apple.com/macosx/features/unix/

So I would say that isunix() should return true on Mac and also ismac() should
return true. According to Jordi's improvement my final suggestion is to place the ismac() function file into the directory <Octave>/scripts/miscellaneous.

  Thomas

diff -r -u -u ./scripts/miscellaneous/Makefile.in 
./scripts/miscellaneous/Makefile.in
--- ./scripts/miscellaneous/Makefile.in.orig    2007-09-02 10:46:10.000000000 
+0200
+++ ./scripts/miscellaneous/Makefile.in 2007-09-02 12:19:34.000000000 +0200
@@ -24,7 +24,7 @@
   compare_versions.m computer.m copyfile.m cputime.m \
   delete.m dir.m doc.m dos.m dump_prefs.m \
   fileattrib.m fileparts.m flops.m fullfile.m getfield.m gunzip.m \
-  inputname.m ispc.m isunix.m license.m list_primes.m ls.m \
+  inputname.m ismac.m ispc.m isunix.m license.m list_primes.m ls.m \
   ls_command.m menu.m mex.m mexext.m mkoctfile.m movefile.m \
   news.m orderfields.m pack.m paren.m parseparams.m \
   semicolon.m setfield.m single.m substruct.m tar.m \
diff -r -u -u ./scripts/miscellaneous/dos.m ./scripts/miscellaneous/dos.m
--- ./scripts/miscellaneous/dos.m.orig  2007-09-02 10:46:10.000000000 +0200
+++ ./scripts/miscellaneous/dos.m       2007-09-02 12:21:35.000000000 +0200
@@ -25,7 +25,7 @@
 ## in @var{status} and any output sent to the standard output in
 ## @var{text}.  If the optional second argument @code{"-echo"} is given,
 ## then also send the output from the command to the standard output.
-## @seealso{unix, isunix, ispc, system}
+## @seealso{unix, ismac, ispc, isunix, system}
 ## @end deftypefn
 
 ## Author: octave-forge ???
diff -r -u -u ./scripts/miscellaneous/unix.m ./scripts/miscellaneous/unix.m
--- ./scripts/miscellaneous/unix.m.orig 2007-09-02 10:46:10.000000000 +0200
+++ ./scripts/miscellaneous/unix.m      2007-09-02 12:21:59.000000000 +0200
@@ -25,7 +25,7 @@
 ## in @var{status} and any output sent to the standard output in
 ## @var{text}.  If the optional second argument @code{"-echo"} is given,
 ## then also send the output from the command to the standard output.
-## @seealso{isunix, ispc, system}
+## @seealso{ismac, ispc, isunix, system}
 ## @end deftypefn
 
 ## Author: octave-forge ???
## Copyright (C) 2007 Thomas Treichl
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, write to the Free
## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.

## -*- texinfo -*-
## @deftypefn {Function File} {} ismac ()
## Return 1 if Octave is running on a Mac-like system and 0 otherwise.
## @end deftypefn

function retval = ismac ()

  vhost = octave_config_info ("canonical_host_type");
  if (regexp (vhost, '(.+)-darwin(.+)'))
    retval = 1;
  else
    print_usage ();
  endif

endfunction

reply via email to

[Prev in Thread] Current Thread [Next in Thread]