Artifact d4c11c557e18182c22e532164117b7f37b807c71:


0000: 3b 3b 20 2d 2a 2d 20 6d 6f 64 65 3a 20 53 63 68  ;; -*- mode: Sch
0010: 65 6d 65 3b 20 74 61 62 2d 77 69 64 74 68 3a 20  eme; tab-width: 
0020: 32 3b 20 2d 2a 2d 20 3b 3b 0a 0a 28 64 65 66 69  2; -*- ;;..(defi
0030: 6e 65 2d 66 6f 72 65 69 67 6e 2d 74 79 70 65 20  ne-foreign-type 
0040: 69 68 61 6e 64 6c 65 20 28 63 2d 70 6f 69 6e 74  ihandle (c-point
0050: 65 72 20 22 49 68 61 6e 64 6c 65 22 29 0a 09 28  er "Ihandle")..(
0060: 69 68 61 6e 64 6c 65 2d 3e 70 6f 69 6e 74 65 72  ihandle->pointer
0070: 20 23 66 29 0a 09 28 70 6f 69 6e 74 65 72 2d 3e   #f)..(pointer->
0080: 69 68 61 6e 64 6c 65 20 23 66 29 29 0a 0a 28 64  ihandle #f))..(d
0090: 65 66 69 6e 65 2d 66 6f 72 65 69 67 6e 2d 74 79  efine-foreign-ty
00a0: 70 65 20 69 68 61 6e 64 6c 65 2d 6c 69 73 74 20  pe ihandle-list 
00b0: 6e 6f 6e 6e 75 6c 6c 2d 70 6f 69 6e 74 65 72 2d  nonnull-pointer-
00c0: 76 65 63 74 6f 72 0a 09 69 68 61 6e 64 6c 65 2d  vector..ihandle-
00d0: 6c 69 73 74 2d 3e 70 6f 69 6e 74 65 72 2d 76 65  list->pointer-ve
00e0: 63 74 6f 72 29 0a 0a 28 64 65 66 69 6e 65 2d 66  ctor)..(define-f
00f0: 6f 72 65 69 67 6e 2d 74 79 70 65 20 6e 6f 6e 6e  oreign-type nonn
0100: 75 6c 6c 2d 69 68 61 6e 64 6c 65 20 28 6e 6f 6e  ull-ihandle (non
0110: 6e 75 6c 6c 2d 63 2d 70 6f 69 6e 74 65 72 20 22  null-c-pointer "
0120: 49 68 61 6e 64 6c 65 22 29 0a 09 28 69 68 61 6e  Ihandle")..(ihan
0130: 64 6c 65 2d 3e 70 6f 69 6e 74 65 72 20 23 74 29  dle->pointer #t)
0140: 0a 09 28 70 6f 69 6e 74 65 72 2d 3e 69 68 61 6e  ..(pointer->ihan
0150: 64 6c 65 20 23 74 29 29 0a 0a 28 64 65 66 69 6e  dle #t))..(defin
0160: 65 2d 66 6f 72 65 69 67 6e 2d 74 79 70 65 20 69  e-foreign-type i
0170: 73 74 61 74 75 73 20 69 6e 74 0a 09 69 73 74 61  status int..ista
0180: 74 75 73 2d 3e 69 6e 74 65 67 65 72 0a 09 69 6e  tus->integer..in
0190: 74 65 67 65 72 2d 3e 69 73 74 61 74 75 73 29 0a  teger->istatus).
01a0: 0a 28 64 65 66 69 6e 65 2d 66 6f 72 65 69 67 6e  .(define-foreign
01b0: 2d 74 79 70 65 20 69 6e 61 6d 65 2f 75 70 63 61  -type iname/upca
01c0: 73 65 20 63 2d 73 74 72 69 6e 67 0a 09 28 69 6e  se c-string..(in
01d0: 61 6d 65 2d 3e 73 74 72 69 6e 67 20 27 75 70 63  ame->string 'upc
01e0: 61 73 65 29 0a 09 28 73 74 72 69 6e 67 2d 3e 69  ase)..(string->i
01f0: 6e 61 6d 65 20 27 75 70 63 61 73 65 29 29 0a 0a  name 'upcase))..
0200: 28 64 65 66 69 6e 65 2d 66 6f 72 65 69 67 6e 2d  (define-foreign-
0210: 74 79 70 65 20 69 6e 61 6d 65 2f 64 6f 77 6e 63  type iname/downc
0220: 61 73 65 20 63 2d 73 74 72 69 6e 67 0a 09 28 69  ase c-string..(i
0230: 6e 61 6d 65 2d 3e 73 74 72 69 6e 67 20 27 64 6f  name->string 'do
0240: 77 6e 63 61 73 65 29 0a 09 28 69 6e 61 6d 65 2d  wncase)..(iname-
0250: 3e 73 74 72 69 6e 67 20 27 64 6f 77 6e 63 61 73  >string 'downcas
0260: 65 29 29 0a                                      e)).