I am not much of a C programmer, which is something you will all learn
soon enough if you haven't figured it out already. :-)
I need a hand understanding something.
in splitreg.c I see a line which reads
HDR (DATE)
and up at the beginning of the file, I see these lines:
#define HDR(NAME) \
{ \
BasicCell *hcell; \
hcell = xaccMallocTextCell(); \
reg->header_label_cells[NAME##_CELL] = hcell; \
}
now, what does that do? I thought that I understood what a #DEFINE
did, but I guess not. Aren't they kinda like search and replaces for
the preprocessor? I thought that they were. But now this blows that
theory out of the water.
I continue with my thoughts. NAME is the argument which gets passed
into the function. I get that. hrmm... BasicCell is the type of the
variable *hcell. I don't get the *, but owell. Does that mean that
this is really a pointer to the variable hcell, which really exists
outside of this function? _this_ function? _which_ function?
xaccInitSplitRegister ??? I don't see a hcell in
xaccInitSplitRegister. so hcell gets the return value of
xaccMallocTextCell... and that is... in src/register/textcell.c, line
52, okay, it returns cell. does that mean that cell is the name of
the cell which just got initialized?
okay, so hcell is a cell (or the name of the cell?) which is getting
initialized. that's cool. for instance, in one point, hcell could be
the first header cell. hrmm...
ok, NAME shows up on that last line, and it ends up being
reg->header_label_cells[DATE##_CELL] = hcell; right? now, I _really_
don't have a clue with "all that arrow stuff". what does that last
line do?
hey! is #define different than #DEFINE ??? is _that_ what I am
missing?
rob
ps. if i understand #define's, then every time we see HDR (DATE),
those three lines get copied into the source file each time on
the way to/through the preprocessor. Doesn't that bring out a
ton extra BasicCell *hcell; lines??
--
Corporations just aren't more important than individuals. In no area
of life should we be treating corporations as things that really
matter. -- rms
--
Gnucash Developer's List
To unsubscribe send empty email to: [EMAIL PROTECTED]