Artifact
aa74a719c649723b4112d1259cccc208f56609ed:
0000: 74 72 61 6d 70 6f 6c 69 6e 65 20 2d 20 63 6c 6f trampoline - clo
0010: 73 75 72 65 73 20 61 73 20 66 69 72 73 74 2d 63 sures as first-c
0020: 6c 61 73 73 20 43 20 66 75 6e 63 74 69 6f 6e 73 lass C functions
0030: 2e 0a 0a 54 68 69 73 20 6c 69 62 72 61 72 79 20 ...This library
0040: 69 6d 70 6c 65 6d 65 6e 74 73 20 63 6c 6f 73 75 implements closu
0050: 72 65 73 20 61 73 20 66 69 72 73 74 2d 63 6c 61 res as first-cla
0060: 73 73 20 43 20 66 75 6e 63 74 69 6f 6e 73 2e 20 ss C functions.
0070: 41 20 63 6c 6f 73 75 72 65 0a 63 6f 6e 73 69 73 A closure.consis
0080: 74 73 20 6f 66 20 61 20 72 65 67 75 6c 61 72 20 ts of a regular
0090: 43 20 66 75 6e 63 74 69 6f 6e 20 61 6e 64 20 61 C function and a
00a0: 20 70 69 65 63 65 20 6f 66 20 64 61 74 61 20 77 piece of data w
00b0: 68 69 63 68 20 67 65 74 73 20 70 61 73 73 65 64 hich gets passed
00c0: 20 74 6f 0a 74 68 65 20 43 20 66 75 6e 63 74 69 to.the C functi
00d0: 6f 6e 20 77 68 65 6e 20 74 68 65 20 63 6c 6f 73 on when the clos
00e0: 75 72 65 20 69 73 20 63 61 6c 6c 65 64 2e 0a 0a ure is called...
00f0: 54 79 70 69 63 61 6c 20 75 73 65 73 20 6f 66 20 Typical uses of
0100: 63 6c 6f 73 75 72 65 73 20 61 72 65 20 6e 65 73 closures are nes
0110: 74 65 64 20 66 75 6e 63 74 69 6f 6e 73 20 69 6e ted functions in
0120: 20 70 72 6f 67 72 61 6d 6d 69 6e 67 20 6c 61 6e programming lan
0130: 67 75 61 67 65 73 2c 0a 61 6e 64 20 63 61 6c 6c guages,.and call
0140: 2d 62 61 63 6b 20 66 75 6e 63 74 69 6f 6e 73 20 -back functions
0150: 70 61 73 73 65 64 20 74 6f 20 6f 74 68 65 72 20 passed to other
0160: 6c 69 62 72 61 72 69 65 73 2e 0a 0a 0a 49 6e 73 libraries....Ins
0170: 74 61 6c 6c 61 74 69 6f 6e 20 69 6e 73 74 72 75 tallation instru
0180: 63 74 69 6f 6e 73 3a 0a 0a 20 20 20 20 20 20 20 ctions:..
0190: 20 2e 2f 63 6f 6e 66 69 67 75 72 65 0a 20 20 20 ./configure.
01a0: 20 20 20 20 20 6d 61 6b 65 0a 20 20 20 20 20 20 make.
01b0: 20 20 6d 61 6b 65 20 63 68 65 63 6b 0a 20 20 20 make check.
01c0: 20 20 20 20 20 6d 61 6b 65 20 69 6e 73 74 61 6c make instal
01d0: 6c 0a 0a 0a 46 69 6c 65 73 20 69 6e 20 74 68 69 l...Files in thi
01e0: 73 20 70 61 63 6b 61 67 65 3a 0a 0a 20 20 20 20 s package:..
01f0: 44 6f 63 75 6d 65 6e 74 61 74 69 6f 6e 3a 0a 0a Documentation:..
0200: 20 20 20 20 20 20 20 20 52 45 41 44 4d 45 20 20 README
0210: 20 20 20 20 20 20 20 20 20 74 68 69 73 20 74 65 this te
0220: 78 74 0a 20 20 20 20 20 20 20 20 43 4f 50 59 49 xt. COPYI
0230: 4e 47 20 20 20 20 20 20 20 20 20 20 66 72 65 65 NG free
0240: 20 73 6f 66 74 77 61 72 65 20 6c 69 63 65 6e 73 software licens
0250: 65 0a 20 20 20 20 20 20 20 20 50 4c 41 54 46 4f e. PLATFO
0260: 52 4d 53 20 20 20 20 20 20 20 20 6c 69 73 74 20 RMS list
0270: 6f 66 20 73 75 70 70 6f 72 74 65 64 20 70 6c 61 of supported pla
0280: 74 66 6f 72 6d 73 0a 20 20 20 20 20 20 20 20 74 tforms. t
0290: 72 61 6d 70 6f 6c 69 6e 65 2e 33 20 20 20 20 20 rampoline.3
02a0: 6d 61 6e 75 61 6c 20 70 61 67 65 20 69 6e 20 55 manual page in U
02b0: 6e 69 78 20 6d 61 6e 20 66 6f 72 6d 61 74 0a 20 nix man format.
02c0: 20 20 20 20 20 20 20 74 72 61 6d 70 6f 6c 69 6e trampolin
02d0: 65 2e 68 74 6d 6c 20 20 6d 61 6e 75 61 6c 20 70 e.html manual p
02e0: 61 67 65 20 69 6e 20 48 54 4d 4c 20 66 6f 72 6d age in HTML form
02f0: 61 74 0a 0a 20 20 20 20 53 6f 75 72 63 65 3a 0a at.. Source:.
0300: 0a 20 20 20 20 20 20 20 20 74 72 61 6d 70 6f 6c . trampol
0310: 69 6e 65 2e 68 2e 69 6e 20 20 69 6e 63 6c 75 64 ine.h.in includ
0320: 65 20 66 69 6c 65 0a 20 20 20 20 20 20 20 20 74 e file. t
0330: 72 61 6d 70 6f 6c 69 6e 65 2e 63 20 20 20 20 20 rampoline.c
0340: 69 6d 70 6c 65 6d 65 6e 74 61 74 69 6f 6e 20 6f implementation o
0350: 66 20 74 68 65 20 6c 69 62 72 61 72 79 20 66 75 f the library fu
0360: 6e 63 74 69 6f 6e 73 0a 20 20 20 20 20 20 20 20 nctions.
0370: 74 72 61 6d 70 2d 68 70 70 61 2e 73 20 20 20 20 tramp-hppa.s
0380: 20 74 68 65 20 74 72 61 6d 70 6f 6c 69 6e 65 20 the trampoline
0390: 66 6f 72 20 68 70 70 61 2c 20 69 6e 20 61 73 73 for hppa, in ass
03a0: 65 6d 62 6c 79 20 6c 61 6e 67 75 61 67 65 0a 20 embly language.
03b0: 20 20 20 20 20 20 20 74 72 61 6d 70 2d 72 73 36 tramp-rs6
03c0: 30 30 30 2e 53 20 20 20 74 68 65 20 74 72 61 6d 000.S the tram
03d0: 70 6f 6c 69 6e 65 20 66 6f 72 20 72 73 36 30 30 poline for rs600
03e0: 30 2c 20 69 6e 20 61 73 73 65 6d 62 6c 79 20 6c 0, in assembly l
03f0: 61 6e 67 75 61 67 65 0a 20 20 20 20 20 20 20 20 anguage.
0400: 70 72 6f 74 65 78 65 63 2e 63 20 20 20 20 20 20 protexec.c
0410: 20 68 6f 77 20 74 6f 20 73 65 74 20 6d 65 6d 6f how to set memo
0420: 72 79 20 70 72 6f 74 65 63 74 69 6f 6e 20 74 6f ry protection to
0430: 20 65 78 65 63 75 74 61 62 6c 65 2c 20 6e 6f 77 executable, now
0440: 20 75 6e 75 73 65 64 0a 20 20 20 20 20 20 20 20 unused.
0450: 63 61 63 68 65 2e 63 20 20 20 20 20 20 20 20 20 cache.c
0460: 20 68 6f 77 20 74 6f 20 66 6c 75 73 68 20 74 68 how to flush th
0470: 65 20 69 6e 73 74 72 75 63 74 69 6f 6e 20 63 61 e instruction ca
0480: 63 68 65 2c 20 6e 6f 77 20 75 6e 75 73 65 64 0a che, now unused.
0490: 20 20 20 20 20 20 20 20 74 65 73 74 31 2e 63 20 test1.c
04a0: 20 20 20 20 20 20 20 20 20 74 65 73 74 20 70 72 test pr
04b0: 6f 67 72 61 6d 0a 20 20 20 20 20 20 20 20 74 65 ogram. te
04c0: 73 74 32 2e 63 20 20 20 20 20 20 20 20 20 20 74 st2.c t
04d0: 65 73 74 20 70 72 6f 67 72 61 6d 0a 0a 20 20 20 est program..
04e0: 20 49 6e 73 74 61 6c 6c 61 74 69 6f 6e 3a 0a 0a Installation:..
04f0: 20 20 20 20 20 20 20 20 63 6f 6e 66 69 67 75 72 configur
0500: 65 20 20 20 20 20 20 20 20 63 6f 6e 66 69 67 75 e configu
0510: 72 61 74 69 6f 6e 20 73 63 72 69 70 74 0a 20 20 ration script.
0520: 20 20 20 20 20 20 63 6f 6e 66 69 67 75 72 65 2e configure.
0530: 69 6e 20 20 20 20 20 61 75 74 6f 63 6f 6e 66 2d in autoconf-
0540: 32 2e 31 32 20 73 6f 75 72 63 65 20 66 6f 72 20 2.12 source for
0550: 74 68 65 20 63 6f 6e 66 69 67 75 72 61 74 69 6f the configuratio
0560: 6e 20 73 63 72 69 70 74 0a 20 20 20 20 20 20 20 n script.
0570: 20 2e 2e 2f 61 75 74 6f 63 6f 6e 66 2f 2a 20 20 ../autoconf/*
0580: 20 20 61 75 78 69 6c 69 61 72 79 20 63 6f 6e 66 auxiliary conf
0590: 69 67 75 72 61 74 69 6f 6e 20 73 63 72 69 70 74 iguration script
05a0: 73 0a 20 20 20 20 20 20 20 20 4d 61 6b 65 66 69 s. Makefi
05b0: 6c 65 2e 69 6e 20 20 20 20 20 20 4d 61 6b 65 66 le.in Makef
05c0: 69 6c 65 20 6d 61 73 74 65 72 0a 20 20 20 20 20 ile master.
05d0: 20 20 20 63 6f 6e 66 69 67 2e 68 2e 69 6e 20 20 config.h.in
05e0: 20 20 20 20 63 6f 6e 66 69 67 2e 68 20 6d 61 73 config.h mas
05f0: 74 65 72 0a 0a 20 20 20 20 50 6f 72 74 69 6e 67 ter.. Porting
0600: 3a 0a 0a 20 20 20 20 20 20 20 20 50 4f 52 54 49 :.. PORTI
0610: 4e 47 20 20 20 20 20 20 20 20 20 20 70 6f 72 74 NG port
0620: 69 6e 67 20 69 6e 73 74 72 75 63 74 69 6f 6e 73 ing instructions
0630: 0a 20 20 20 20 20 20 20 20 4d 61 6b 65 66 69 6c . Makefil
0640: 65 2e 64 65 76 65 6c 20 20 20 64 65 76 65 6c 6f e.devel develo
0650: 70 65 72 27 73 20 4d 61 6b 65 66 69 6c 65 0a 20 per's Makefile.
0660: 20 20 20 20 20 20 20 70 72 6f 74 6f 2e 63 20 20 proto.c
0670: 20 20 20 20 20 20 20 20 73 61 6d 70 6c 65 20 73 sample s
0680: 6f 75 72 63 65 20 63 6f 6e 74 61 69 6e 69 6e 67 ource containing
0690: 20 61 73 73 69 67 6e 6d 65 6e 74 20 61 6e 64 20 assignment and
06a0: 6a 75 6d 70 69 6e 67 0a 20 20 20 20 20 20 20 20 jumping.
06b0: 70 72 6f 74 6f 2d 2a 2e 73 20 20 20 20 20 20 20 proto-*.s
06c0: 20 69 74 73 20 74 72 61 6e 73 6c 61 74 69 6f 6e its translation
06d0: 20 74 6f 20 61 73 73 65 6d 62 6c 79 20 6c 61 6e to assembly lan
06e0: 67 75 61 67 65 0a 20 20 20 20 20 20 20 20 74 72 guage. tr
06f0: 61 6d 70 2d 2a 2e 73 20 20 20 20 20 20 20 20 74 amp-*.s t
0700: 68 65 20 74 72 61 6d 70 6f 6c 69 6e 65 2c 20 69 he trampoline, i
0710: 6e 20 61 73 73 65 6d 62 6c 79 20 6c 61 6e 67 75 n assembly langu
0720: 61 67 65 0a 20 20 20 20 20 20 20 20 74 72 61 6d age. tram
0730: 70 2d 2a 2e 6f 20 20 20 20 20 20 20 20 74 68 65 p-*.o the
0740: 20 74 72 61 6d 70 6f 6c 69 6e 65 2c 20 69 6e 20 trampoline, in
0750: 62 69 6e 61 72 79 20 66 6f 72 6d 0a 0a 0a 43 6f binary form...Co
0760: 70 79 72 69 67 68 74 20 6e 6f 74 69 63 65 3a 0a pyright notice:.
0770: 0a 43 6f 70 79 72 69 67 68 74 20 31 39 39 35 20 .Copyright 1995
0780: 42 72 75 6e 6f 20 48 61 69 62 6c 65 2c 20 3c 62 Bruno Haible, <b
0790: 72 75 6e 6f 40 63 6c 69 73 70 2e 6f 72 67 3e 0a runo@clisp.org>.
07a0: 0a 54 68 69 73 20 69 73 20 66 72 65 65 20 73 6f .This is free so
07b0: 66 74 77 61 72 65 20 64 69 73 74 72 69 62 75 74 ftware distribut
07c0: 65 64 20 75 6e 64 65 72 20 74 68 65 20 47 4e 55 ed under the GNU
07d0: 20 47 65 6e 65 72 61 6c 20 50 75 62 6c 69 63 20 General Public
07e0: 4c 69 63 65 6e 63 65 0a 64 65 73 63 72 69 62 65 Licence.describe
07f0: 64 20 69 6e 20 74 68 65 20 66 69 6c 65 20 43 4f d in the file CO
0800: 50 59 49 4e 47 2e 20 43 6f 6e 74 61 63 74 20 74 PYING. Contact t
0810: 68 65 20 61 75 74 68 6f 72 20 69 66 20 79 6f 75 he author if you
0820: 20 64 6f 6e 27 74 20 68 61 76 65 20 74 68 69 73 don't have this
0830: 0a 6f 72 20 63 61 6e 27 74 20 6c 69 76 65 20 77 .or can't live w
0840: 69 74 68 20 69 74 2e 20 54 68 65 72 65 20 69 73 ith it. There is
0850: 20 41 42 53 4f 4c 55 54 45 4c 59 20 4e 4f 20 57 ABSOLUTELY NO W
0860: 41 52 52 41 4e 54 59 2c 20 65 78 70 6c 69 63 69 ARRANTY, explici
0870: 74 20 6f 72 20 69 6d 70 6c 69 65 64 2c 0a 6f 6e t or implied,.on
0880: 20 74 68 69 73 20 73 6f 66 74 77 61 72 65 2e 0a this software..
0890: 0a 0a 42 72 75 6e 6f 20 48 61 69 62 6c 65 0a 3c ..Bruno Haible.<
08a0: 62 72 75 6e 6f 40 63 6c 69 73 70 2e 6f 72 67 3e bruno@clisp.org>
08b0: 0a 0a ..