Re: Running safe.e ???

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Fri, Sep 19, 2003 at 12:43:54PM -0400, Bernie Ryan wrote:
> 
> 
> Rob: Why does this fail ?

Works fine under Linux, Eu 2.3

>      Also will location a always contain a terminating zero ?

Yes. From allocate_string() in safe.e, line 821:

global function allocate_string(sequence s)
-- create a C-style null-terminated string in memory
    atom mem

    mem = allocate(length(s) + 1)
    poke(mem, s & 0)
    return mem
end function

For an empty sequence, you get:

    mem = allocate(0 + 1)
    poke(mem, "" & 0)
    return mem
> 
> ===================================
> include safe.e
> 
> atom a a = allocate_string("")
> ? a
> ? peek(a)
> 
> if getc(0) then
>  -- pause 
> end if
> ===================================
> 
> Bernie
> 
> 
> 
> TOPICA - Start your own email discussion group. FREE!
> 
> 

-- 
"Is there peace in heaven, or is that merely an illusion?" - Someone

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu