Macro explanation?
Randy Kramer
rhkramer at gmail.com
Sun Nov 11 16:07:37 CET 2007
<background>
I'm (finally) trying to work my way through some of the nedit code in hopes of
someday adding folding capability. Up to this point, I've been mostly
browsing through the code, using comments to get a general idea of what's
going on. I'm currently in textDisp.c, and I have a lot more of that kind of
browsing to do. But I'm also trying to see if I can understand some of the
code. I can understand some, but I'm not there with macros yet (by any
means). I've done some googling re macros, and I'm now working my way
through a document named "The C
Preprocessor" (http://developer.apple.com/documentation/DeveloperTools/gcc-4.0.1/cpp/Diagnostics.html#Diagnostics).
<\background>
But, if anybody feels like helping, I think it would help me to understand the
following macro (from textDisp.c). Maybe somebody could show me what it
looks like expanded? Or provide (or point me to) an explanation.
/* Macro for getting the TextPart from a textD */
#define TEXT_OF_TEXTD(t) (((TextWidget)((t)->w))->text)
Also, I have a vague understanding of the "->" operator--iiuc (google isn't a
whole lot of help here it doesn't want to search for a "->", and I don't know
the name of it). IIUC, it is used to select an element of a struct, and is
an alternate to the "." operator. Further (iiuc), the "." operator is used
in "normal" circumstances, while the "->" is used when a pointer is involved?
Randy Kramer
(Sorry, I woke up with a headache today, and I'm finding it hard to
concentrate--I know that I could do more googling, and may, but help would be
appreciated.)
More information about the Develop
mailing list