edbrowse-dev - development list for edbrowse
 help / color / mirror / Atom feed
From: Adam Thompson <arthompson1990@gmail.com>
To: Karl Dahlke <eklhad@comcast.net>
Cc: Edbrowse-dev@lists.the-brannons.com
Subject: Re: [Edbrowse-dev] interprocess shared files
Date: Thu, 14 May 2015 23:00:13 +0100	[thread overview]
Message-ID: <20150514220013.GI2917@toaster.adamthompson.me.uk> (raw)
In-Reply-To: <20150414155503.eklhad@comcast.net>

[-- Attachment #1: Type: text/plain, Size: 2122 bytes --]

On Thu, May 14, 2015 at 03:55:03PM -0400, Karl Dahlke wrote:
> Ok, that wasn't hard.
> stringfile.c url.c messages.c is now a group of code that is
> shared between any and all of the edbrowse processes,
> even those that are c++.
> The tweak that makes the latter possible is this in eb.h.
> 
> #ifndef __cplusplus
> typedef uchar bool;
> #define false 0
> #define true 1
> #endif
> 
> No other plusplus conditional compilation is necessary, anywhere.
> That's good cause I dislike conditional compilation.

I've slightly altered this such that we now don't need ++.o versions. This was achieved by adding:
#ifdef __cplusplus
extern "C" {
#endif

After we've ran the above conditional typedef compilation and:
#ifdef __cplusplus
}
#endif
At the end of eb.h
This means we don't have to duplicate dependancies for these files in the
makefile, thus reducing the possibility for build problems later.

> I did have to make some other changes in the c files but those are minor
> and work fine in either language.
> One silly example was the use of new as a variable,
> which obviously blows up in c++ so I just rename the variable.
> Anyways Adam you are good to go with
> 
> cp jseng-moz.cpp jseng-duk.c
> 
> and give it a whirl.
> There are over 500 lines of code less than there use to be,
> so you won't have to waste time on that,
> and you have access to more functions,
> including the string management functions that you will need
> to replace the dynamic c++ strings,
> which there are only a couple in the file anyways.

Thanks for doing this, it'll certainly make things easier.

> The only aesthetic downer is jseng use to include ebjs.h, small and contained,
> but now it includes eb.h, which is everything.
> It might be worth making a common.h intermediate to embrase the common files.
> I'll hold that off for another day.

I'm not too sure I mind this that much.
At the end of the day it's not that bad and we shouldn't really have any
conflicting types etc which'd make this a problem.
A common.h would potentially be nicer though.

Cheers,
Adam.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

  reply	other threads:[~2015-05-14 22:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-14 19:55 Karl Dahlke
2015-05-14 22:00 ` Adam Thompson [this message]
2015-05-14 22:32   ` Karl Dahlke
2015-05-14 22:39     ` 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=20150514220013.GI2917@toaster.adamthompson.me.uk \
    --to=arthompson1990@gmail.com \
    --cc=Edbrowse-dev@lists.the-brannons.com \
    --cc=eklhad@comcast.net \
    /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).