From: Benjohn Barnes Date: 2007-01-09T08:32:31+09:00 Subject: DL Type Specifiers (was: Online browsable ruby source tree) On 8 Jan 2007, at 22:27, Nick Sieger wrote: > On 1/8/07, Benjohn Barnes wrote: >> >> Hi, I'm looking about for a browsable online version of Ruby's source >> code, but I've not found one. Anyone come across such a thing? > > > http://svn.ruby-lang.org/ (newly minted, may not be linked widely yet) That's marvellous, thank you. :) Having looked in the "ext/dl" folder though, it no longer has a "doc" sub folder. Perhaps the content has been moved in line? For anyone after the same info as me, and for the archives, here's the type specifier section of the DL documentation: > == Type specifiers > > the prototype consists of the following type specifiers, first > element of > prototype represents the type of return value, and remaining > elements represent > the type of each argument. > > C : char > c : char * > H : short > h : short * > I : int > i : int * > L : long > l : long * > F : float > f : float * > D : double > d : double * > S : const char * > s : char * > A : const type[] > a : type[] (allocates new memory space) > P : void * (same as 'p') > p : void * (same as 'P') > 0 : void function (this must be a first character of the > prototype) > > the cbtype consists of type specifiers 0, C, I, H, L, F, D, S and P. > for example: > > DL.callback('IPP'){|ptr1,ptr2| > str1 = ptr1.ptr.to_s > str2 = ptr2.ptr.to_s > str1 <=> str2 > } > =end Cheers, Benjohn