The link does not load from where I live. Google cache works....
You can put fields or references (pointers) into that record (the record I gave you is a blueprint for the header)
You can nest records, too.
type
PMyLinkedHead = ^TMyLinkedHead; // Forward declaration pointer to the record
TMyLinkedHead = record
Prev, Next: PMyLinkedHead;
end;
TData = record
// ...
end;
TListEntry = record
Head: TMyLinkedHead;
Data: TData;
end;
Note you must then write
ListEntry.Head.Next^
or
ListEntry.Data.Foo...
I do not know what you want to do on top of that.
Also there is one point I do not know the exact answer, so you may need to google it.
Compilers "align" they fields (the add padding).
record a: byte; b: int64; end;
will create a structure that may have 3 or 7 empty bytes after "a".
I do not know what gcc does...
You can change that by using "packed", or changing compiler settings.
But I do not have the details...
The point is, if you call a c-library, it does not care how your code looks. It cares where in memory each bit of the data is.
you should change the "title" of your post.
Edit your first post in this thread, and change the title: "Linked lists" or "self referring structures" ....