edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Karl Dahlke <eklhad@comcast.net>
To: Edbrowse-dev@lists.the-brannons.com
Subject: [Edbrowse-dev]  tag list
Date: Sat, 01 Mar 2014 14:24:32 -0500	[thread overview]
Message-ID: <20140201142432.eklhad@comcast.net> (raw)

Yeah, this is something I got confused about too,
until Chris set me straight.
Duh - I wrote it - and then I got confused about it.
I can be dumb as a box of rocks sometimes.
The linked list or array or vector or whatever holds pointers
to struct htmlTag, not the struct itself.
So structs can go ahead and point to each other as parents and children,
because the structs don't move.
The growing vector simply reallocates the list of pointers to those structures.

I already do this, don't I?
t->controller is the form that owns the input tag,
and for an option t->controller is the select that owns the option.
Just rename controller parent and you're halfway there.

So with this in mind 

static list < struct htmlTag *>htmlStack;

becomes

static vector < struct htmlTag *>htmlStack;

Then sure it's all normal after that, and I'd just love to
set cw->tags to htmlStack, but cw->tags
is one of those things that is in C, not C++.
In fact it's in eb.h, thus in every C file,
so we'd have to use void * or some such, or convert the whole project to C++.
But that's the idea, and we can certainly move forward there.
Then there is no trouble adding new tags as we need to,
as js creates new thingees for us.

Karl Dahlke

             reply	other threads:[~2014-03-01 19:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-01 19:24 Karl Dahlke [this message]
2014-03-02 13:47 ` Adam Thompson
  -- strict thread matches above, loose matches on Subject: below --
2014-03-02 14:15 Karl Dahlke
2014-03-02 19:28 ` Adam Thompson
2014-03-01 14:00 Karl Dahlke
2014-03-01 19:01 ` Adam Thompson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140201142432.eklhad@comcast.net \
    --to=eklhad@comcast.net \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).