Dear i do not understand why the first example works and the second
segfault. Thanks
EXAMPLE 1 ---
// ldc2 -L=/usr/lib64/libXlib.so -L-lX11 -g -w xtest.d
import std.string;
import std.stdio;
import std.conv;
import std.c.stdlib : getenv;
import std.exception :
What's the definition of Display?
Le mardi 10 janvier 2012 à 01:26 +0100, Trass3r a écrit :
What's the definition of Display?
This one:
_
struct _XDisplay{
XExtData* ext_data; /* hook for
extension to hang data */
_XPrivate* private1;
It's likely a module Gmail - Problem with interfacing C code to D -
Mozilla Firefo;
import std.algorithm;
import std.array;
import std.stdio;
void main()
{
}
On 1/10/12, bioinfornatics bioinfornat...@fedoraproject.org wrote:
Le mardi 10 janvier 2012 à 01:26 +0100, Trass3r a écrit :
What's
Jesus christ, sorry about that my keyboard script went crazy and posted that.
What I was going to say is it's likely a mismatch of the struct sizes.
In the second example you are dereferencing the pointer on the D size,
which does a field-by-field copy of the pointed-to struct. But D will
only
On 01/10/12 01:02, bioinfornatics wrote:
Dear i do not understand why the first example works and the second
segfault. Thanks
EXAMPLE 1 ---
Display* display = XOpenDisplay(getenv(DISPLAY));
char** fonts = XListFonts( display, pattern.dup.ptr, 10,
Scratch that, in X11 apparently the Display structure is an incomplete
type (so sizeof won't work). This means you most probably *have* to
use pass it around as an opaque pointer. It's kind of odd because you
can still access some of its fields (so it's not totally opaque), but
you can't do