Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

God made machine language; all the rest is the work of man.


devel / comp.lang.tcl / Re: reading errorCode from C level

SubjectAuthor
* reading errorCode from C levelRalf Fassel
`- Re: reading errorCode from C levelEmiliano Gavilan

1
reading errorCode from C level

<ygazftgfora.fsf@panther.akutech-local.de>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13326&group=comp.lang.tcl#13326

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail
From: ralf...@gmx.de (Ralf Fassel)
Newsgroups: comp.lang.tcl
Subject: reading errorCode from C level
Date: Fri, 26 Apr 2024 11:37:45 +0200
Lines: 20
Message-ID: <ygazftgfora.fsf@panther.akutech-local.de>
Mime-Version: 1.0
Content-Type: text/plain
X-Trace: individual.net hegSmOQqf10alplU2/5ghgLIMv8EATlcYQmWy+ClyN5aqP63Q=
Cancel-Lock: sha1:bapzRg9mc2CMuvQiTwGAyQ4/jT8= sha1:qS3jNzqZwrfBZazTNZyCsdagyYo= sha256:wqz7DijmqpgV0dqoB0CDdmGh5PmhEVWdM1NhxYoDEd8=
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux)
 by: Ralf Fassel - Fri, 26 Apr 2024 09:37 UTC

My intention is to switch after an !TCL_OK return value from Tcl_EvalEx() to
decide whether a TCL-related error has happend, or some POSIX system
call error (the cmd called is a "create-socket" call).

// pseudo code
Tcl_SetErrno(0); // not sure if that reset is necessary
if (TCL_OK != Tcl_EvalEx(interp, cmd_str, cmd_size, TCL_EVAL_GLOBAL)) {
// right now I'm doing:
if (0 != Tcl_GetErrno()) {
// assume POSIX error
} else {
// assume TCL script level error
}
}

Short of Tcl_ObjGetVar2("errorCode") and looking at the first element of
the returned list being "POSIX" in case of an error, is there a better way?

TNX
R'

Re: reading errorCode from C level

<20240426094958.a55950a8a0188e7097f0efa1@example.invalid>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=13327&group=comp.lang.tcl#13327

  copy link   Newsgroups: comp.lang.tcl
Path: i2pn2.org!i2pn.org!usenet.network!eternal-september.org!feeder3.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: emi...@example.invalid (Emiliano Gavilan)
Newsgroups: comp.lang.tcl
Subject: Re: reading errorCode from C level
Date: Fri, 26 Apr 2024 09:49:58 -0300
Organization: A noiseless patient Spider
Lines: 25
Message-ID: <20240426094958.a55950a8a0188e7097f0efa1@example.invalid>
References: <ygazftgfora.fsf@panther.akutech-local.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: 7bit
Injection-Date: Fri, 26 Apr 2024 14:50:02 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="d689665484ffe5f8ee5415ed3e70da6f";
logging-data="3894761"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+/rZeGmMmOwJUUAgUSH8ux2xFBVKcKOYo="
Cancel-Lock: sha1:EwnNCiTM+YmYoJoyGr/1BmCjtaU=
X-Newsreader: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu)
 by: Emiliano Gavilan - Fri, 26 Apr 2024 12:49 UTC

On Fri, 26 Apr 2024 11:37:45 +0200
Ralf Fassel <ralfixx@gmx.de> wrote:

> My intention is to switch after an !TCL_OK return value from Tcl_EvalEx() to
> decide whether a TCL-related error has happend, or some POSIX system
> call error (the cmd called is a "create-socket" call).
>
> // pseudo code
> Tcl_SetErrno(0); // not sure if that reset is necessary
> if (TCL_OK != Tcl_EvalEx(interp, cmd_str, cmd_size, TCL_EVAL_GLOBAL)) {
> // right now I'm doing:
> if (0 != Tcl_GetErrno()) {
> // assume POSIX error
> } else {
> // assume TCL script level error
> }
> }
>
> Short of Tcl_ObjGetVar2("errorCode") and looking at the first element of
> the returned list being "POSIX" in case of an error, is there a better way?

Tcl_GetReturnOptions()

--
Emiliano


devel / comp.lang.tcl / Re: reading errorCode from C level

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor