From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-we0-x234.google.com (mail-we0-x234.google.com [IPv6:2a00:1450:400c:c03::234]) by hurricane.the-brannons.com (Postfix) with ESMTPS id DD8267862B for ; Sun, 2 Mar 2014 05:49:04 -0800 (PST) Received: by mail-we0-f180.google.com with SMTP id p61so906555wes.25 for ; Sun, 02 Mar 2014 05:47:57 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=dq1Mf6vuZVCf9x0m7zKL+Z2eMEWOy5XkOXUIjccA644=; b=YQHTVTABXN3k2Gbx5Nyak0EOvilQXS+oD/3jZdOqpUFb4uPoPO0afHkRxSuxhxOdcf 2GP0hrwP9b14QsV8Z6COe9sRtR1fjsX+cjoTJ6gyoWcn8rTCsPh+SLi+C5MmT4VPOTGv UY32QwIWTaYDkbkcojR9ppRNutfT1xGScEt+CXypN8e1Rdj9WC74/K0o6kuYxSJ8H9Xp dr/SANjCfGQgXcYSzeoXfdGIckwxfBh58qTyiOckgJVhDBoLKoRYtipL6VCvxHTNLwaz +pXIW7FVvhmGJYuRMsILNUldQM+cE1ypPcEtSi66AYtlnIsUNDCeBO8RSTr233QTCJNY rgYQ== X-Received: by 10.180.102.42 with SMTP id fl10mr11035083wib.42.1393768076923; Sun, 02 Mar 2014 05:47:56 -0800 (PST) Received: from toaster.adamthompson.me.uk (toaster.adamthompson.me.uk. [2001:8b0:1142:9042::2]) by mx.google.com with ESMTPSA id t6sm25135440wix.4.2014.03.02.05.47.55 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Sun, 02 Mar 2014 05:47:55 -0800 (PST) Date: Sun, 2 Mar 2014 13:47:52 +0000 From: Adam Thompson To: Karl Dahlke Message-ID: <20140302134752.GM19851@toaster.adamthompson.me.uk> References: <20140201142432.eklhad@comcast.net> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="7gLe/sNPhR777EPF" Content-Disposition: inline In-Reply-To: <20140201142432.eklhad@comcast.net> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Edbrowse-dev@lists.the-brannons.com Subject: Re: [Edbrowse-dev] tag list X-BeenThere: edbrowse-dev@lists.the-brannons.com X-Mailman-Version: 2.1.17 Precedence: list List-Id: Edbrowse Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 02 Mar 2014 13:49:05 -0000 --7gLe/sNPhR777EPF Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sat, Mar 01, 2014 at 02:24:32PM -0500, Karl Dahlke wrote: > 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. I remembered something about this after I replied but couldn't remember the= =20 details. At some stage I really need to familiarise myself with the html code. > 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 struc= tures. Stupid question, and appologies if this's already been asked, but why are we storing a list of pointers? >=20 > 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. We also need to store a list of children in each tag, i.e. in the code:

whatever

Some more text

Footer text

The body would have a list of two pointers to the two div tags, the first div tag would need to hold a list of two pointers to the two p ta= gs under it, whilst the second div tag only has one pointer to the p tag under= it. As you say though, each tag only needs a single parent link, which simplifies things. >=20 > So with this in mind=20 >=20 > static list < struct htmlTag *>htmlStack; >=20 > becomes >=20 > static vector < struct htmlTag *>htmlStack; >=20 > 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++. Or according to [1] set it to: cw->tags =3D &htmlStack.front(); > But that's the idea, and we can certainly move forward there. No need to do this rewrite at the moment, and I think we need to get the js stuff sorted before we start contemplating any possible benefits (I'm still not entirely convinced honestly) of doing = this. > Then there is no trouble adding new tags as we need to, > as js creates new thingees for us. Yeah, as long as we ensure we append the correct child list and set the par= ent pointer correctly. Cheers, Adam. [1] http://stackoverflow.com/questions/6485496/how-to-get-stdvector-pointer= -to-the-raw-data --7gLe/sNPhR777EPF Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQEcBAEBAgAGBQJTEzaIAAoJELZ22lNQBzHO+JgIANB8aURX1wtFkzHIZr0gd2d5 F+Pg+k1YHtKuk70zS5WNesJK07aprZbc+60Y5mviwlXXG1M3P0bCIfvzl1GXqs8+ h7fkZwpijF7fImenRyn+MOIGQpHWAag49kbvC2IbJnNrT1jnUsfOCxuFjpAYNddI XVfqIphEuzThlSWc6AM/JuVr6jALiK5RXzqU/gUxfH/U4WwtsEGxcbxG7kmwbcKo AUVuZCG3h0+L940dxWTp3MfdjGutsMPKrIW2DyirrAkZv8V9Eo5WdFBUT/7bTAQg DSzpk0I7OShjdqW5JVpaANdaxGaBQhkEcKdHGA5a4wz/ZueWFpWcDuojFwR/kdg= =I4ar -----END PGP SIGNATURE----- --7gLe/sNPhR777EPF--