ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: "Yue Wang" <yuleopen@gmail.com>
To: "Mailing list for ConTeXt users" <ntg-context@ntg.nl>
Subject: Re: [LUATEX] uname() volunteers needed
Date: Thu, 22 May 2008 18:26:51 +0800	[thread overview]
Message-ID: <68bfdc900805220326i6e888522ucbd37ad134091f37@mail.gmail.com> (raw)
In-Reply-To: <20080521220015.GR21340@phare.normalesup.org>

Hi, Arthur and Taco


On 5/22/08, Arthur Reutenauer <arthur.reutenauer@normalesup.org> wrote:
> > No; instead of (uname(&uts)) it should be (uname(&uts) < 0) .
>
>  Well, no: if the function fails on Linux and returns, say, 1, this
> test wouldn't catch it.  But Taco knows what to do, and the discussion
> is getting even more off-topic :-)
>

No, It wont. In Linux/FreeBSD/Mac OS X, -1 will return if it failed. I
am pretty sure about that because I read the manual pages of these
operating systems yesterday.


Again, see the Open Group Specification,  (all the Unix and Unix like
operating system should follow the Open Group Specification or
otherwise it cannot be called Unix or Unix like. There is no need for
us to pay attention to the non-Unix(like) systems apart from
Windows.):

http://www.opengroup.org/onlinepubs/009695399/basedefs/sys/utsname.h.html

The return value section:  A NON-NEGATIVE VALUE shall be returned.
Otherwise -1 should be returned and set errono to indicate an error.

so we should better write our program like this:

if (uname(&uts)<0) {  /*or we can also say if uname(&uts)==-1*/
    puts("uname() failed");
}

Here Taco, as I said yesterday, there is no need to leave a #ifdef for
the solaris operating system. Just remove all the jungles and remain
only one #ifdef for Windows system, and leave the rest time to spend a
good weekend:)

>Because I do not want to alter the lua return values, that means I will have to interpret the contents of the returned structure a bit.

I think it is better to only return a table while calling the Lua
function. The table contains key=value pairs for
{sysname=,nodename=,release=, version=,machine=}. For Windows, you
just fill these names by hand instead(easy, isn't it?). Keep the
problem small and simple, as well as flexible, and leave everything
toplevel for higher programs like ConTeXt. LuaTeX is going public in
months, so before that every major API change is OK to the developers.
After public, changing APIs will make other developers unhappy.

Yue Wang
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : https://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


  parent reply	other threads:[~2008-05-22 10:26 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-21 12:11 Taco Hoekwater
2008-05-21 12:25 ` Thomas A. Schmitz
2008-05-21 12:59   ` Yue Wang
2008-05-21 13:44     ` Thomas A. Schmitz
2008-05-21 12:43 ` Jin-Hwan Cho
2008-05-21 13:43 ` Arthur Reutenauer
2008-05-21 14:26   ` Yue Wang
2008-05-21 20:22   ` Martin Schröder
2008-05-21 22:00     ` Arthur Reutenauer
2008-05-21 22:15       ` Martin Schröder
2008-05-21 23:59         ` Arthur Reutenauer
2008-05-22 10:26       ` Yue Wang [this message]
2008-05-22 11:21         ` Taco Hoekwater
2008-05-22 13:50           ` luigi scarso
2008-05-22 14:11             ` Hans Hagen
2008-05-22 14:18               ` luigi scarso
2008-05-22 11:28         ` Hans Hagen
2008-05-21 18:40 ` Peter Münster
2008-05-21 19:42 ` Diego Depaoli
2008-05-21 20:09 ` Gour
2008-05-21 20:35   ` Michael Hallgren
2008-05-22 12:22 ` Taco Hoekwater
2008-05-22 23:39 ` [LUATEX] " Mojca Miklavec

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=68bfdc900805220326i6e888522ucbd37ad134091f37@mail.gmail.com \
    --to=yuleopen@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).