Subject: [clisp-list] exporting reader functions for slots?

From: "Hoehle, Joerg-Cyril" <[email-masked]>
Date: Tue Apr 1 06:07:12 2003

Hi,

>Joerg, what's up?!
I don't know. I still have to manage to build a CLISP with modules on Linux (no, no help needed for now).

Please tell me if combinations of these work for you:
A:> (linux:fprintf0 linux:stdout "hi")

B:FFI[97]> (with-foreign-object (x 'passwd (make-passwd :pw_name "name" :pw_passwd "pw" :pw_uid 1 :pw_gid 2 :pw_gecos "geck" :pw_dir "/root/" :pw_shell "Bourne")) (print (foreign-type x)) (describe x)(foreign-value x))

#(C-STRUCT #(PW_NAME PW_PASSWD PW_UID PW_GID PW_GECOS PW_DIR PW_SHELL)
  #<COMPILED-CLOSURE :LAMBDA> C-STRING C-STRING UINT UINT C-STRING C-STRING
  C-STRING) 

#<FOREIGN-VARIABLE "FOREIGN-VARIABLE" #x0032A5AC> is a foreign variable of 
foreign type 
(C-STRUCT NIL (PW_NAME C-STRING) (PW_PASSWD C-STRING) (PW_UID UINT)
 (PW_GID UINT) (PW_GECOS C-STRING) (PW_DIR C-STRING) (PW_SHELL C-STRING)).

#S(PASSWD :PW_NAME "name" :PW_PASSWD "pw" :PW_UID 1 :PW_GID 2 :PW_GECOS "geck"
   :PW_DIR "/root/" :PW_SHELL "Bourne")

That tests conversion from and to foreign world, without any foreign function.

C:
#0  0x080b1283 in nls_asciiext_wcstombs (encoding={one_o = 539610993},
What is your custom:*default-foreign-encoding*? ASCII?

Regards,
	Jörg Höhle.

---

From: Sam Steingold <[email-masked]>
Date: Tue Apr 1 06:52:06 2003

> * In message <[email-masked]>
> * On the subject of "[clisp-list] exporting reader functions for slots?"
> * Sent on Tue, 1 Apr 2003 14:59:18 +0200
> * Honorable "Hoehle, Joerg-Cyril" <[email-masked]> writes:
>

[1]> (linux:fprintf0 linux:stdout "hi")

*** - handle_fault error2 ! address = 0xfbad20ca not in [0x6803d8a0,0x68089000) !
SIGSEGV cannot be cured. Fault address = 0xfbad20ca.
Segmentation fault

> B:FFI[97]> (with-foreign-object (x 'passwd (make-passwd :pw_name "name" :pw_passwd "pw" :pw_uid 1 :pw_gid 2 :pw_gecos "geck" :pw_dir "/root/" :pw_shell "Bourne")) (print (foreign-type x)) (describe…

[17]> (ffi:with-foreign-object (x 'linux:passwd (linux::|MAKE-passwd| :|pw_name| "name" :|pw_passwd| "pw" :|pw_uid| 1 :|pw_gid| 2 :|pw_gecos| "geck" :|pw_dir| "/root/" :|pw_shell| "Bourne")) (print (ffi::foreign-type x)) (describe x)(ffi:foreign-value x))

#(FFI:C-STRUCT LINUX:passwd (:EXTERNAL)
  #(LINUX::pw_name LINUX::pw_passwd LINUX::pw_uid LINUX::pw_gid LINUX::pw_gecos
    LINUX::pw_dir LINUX::pw_shell)
  #<COMPILED-CLOSURE :LAMBDA> FFI:C-STRING FFI:C-STRING FFI:UINT FFI:UINT
  FFI:C-STRING FFI:C-STRING FFI:C-STRING) 

#<FOREIGN-VARIABLE "FOREIGN-VARIABLE" #xBFFF8F10> is a foreign variable of 
foreign type 
(FFI:C-STRUCT LINUX:passwd (:EXTERNAL) (LINUX::pw_name FFI:C-STRING)
 (LINUX::pw_passwd FFI:C-STRING) (LINUX::pw_uid FFI:UINT)
 (LINUX::pw_gid FFI:UINT) (LINUX::pw_gecos FFI:C-STRING)
 (LINUX::pw_dir FFI:C-STRING) (LINUX::pw_shell FFI:C-STRING)).
#S(LINUX:passwd :|pw_name| "name" :|pw_passwd| "pw" :|pw_uid| 1 :|pw_gid| 2
   :|pw_gecos| "geck" :|pw_dir| "/root/" :|pw_shell| "Bourne")

> What is your custom:*default-foreign-encoding*? ASCII?

[23]> custom:*foreign-encoding*
#<ENCODING CHARSET:ISO-8859-1 :UNIX>

-- 
Sam Steingold (http://www.podval.org/~sds) running RedHat8 GNU/Linux
<http://www.camera.org> <http://www.iris.org.il> <http://www.memri.org/>
<http://www.mideasttruth.com/> <http://www.palestine-central.com/links.html>
Lottery is a tax on statistics ignorants.  MS is a tax on computer-idiots.