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

Re: questions regarding ffi



Dan Stanger <dxs@evolving.com> asks:

> (def-c-struct utsname
>   (sysname (c-array char #._SYS_NMLN))
>   (nodename (c-array char #._SYS_NMLN))
>   (release (c-array char #._SYS_NMLN))
>   (version (c-array char #._SYS_NMLN))
>   (machine (c-array char #._SYS_NMLN))
> )

> is there a way to declare utsname so that the structure members are strings
> rather than these arrays.

In the next clisp version, you will be able to write

(def-c-struct utsname
  (sysname (c-array-max character #._SYS_NMLN))
  (nodename (c-array-max character #._SYS_NMLN))
  (release (c-array-max character #._SYS_NMLN))
  (version (c-array-max character #._SYS_NMLN))
  (machine(c-array-max character #._SYS_NMLN))
)

The conversions will then have exactly the desired behaviour.


                    Bruno Haible
                    haible@ma2s2.mathematik.uni-karlsruhe.de