delorie.com/archives/browse.cgi | search |
X-Authentication-Warning: | delorie.com: mail set sender to geda-user-bounces using -f |
X-Recipient: | geda-user AT delorie DOT com |
X-Original-DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; |
d=gmail.com; s=20120113; | |
h=mime-version:in-reply-to:references:date:message-id:subject:from:to | |
:content-type; | |
bh=8jo4/+jtN2HpT0e9pWJTppq72XDDXEye2KwbVVjqLw4=; | |
b=H53b6fOc2bhPLNesELhXZglEZank8I8258YOgCzvY8+07HcSXfy64spNC2t6a6nf6I | |
zlF9CtlsIUsu7+9hbkjy3gifTHP5R+K7FvcefQ+QPJQkdPz0YfKdAYN+fHki6fugv84n | |
ssF/pwVtwf0OOpaRipOc0erDBZPve7+RNREbvrVklv7bcfSTb7S5/L6WFncarRwS+WRi | |
GKLMzsC/KTjogS4WSAM5CpvhZCaj93wGSdtIPjCtmrOy+szvluj6tuIdt1TzVI7/DIYY | |
EdjzqzhxhAVaJ60wxolDBTZU3qVSzQOyRddXQgCbgUDTvfewb+VZPWxFX5ZVLimCcdM1 | |
1WaA== | |
X-Google-DKIM-Signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; |
d=1e100.net; s=20130820; | |
h=x-gm-message-state:mime-version:in-reply-to:references:date | |
:message-id:subject:from:to:content-type; | |
bh=8jo4/+jtN2HpT0e9pWJTppq72XDDXEye2KwbVVjqLw4=; | |
b=Rq2DsYM9Barz7mfpMx5OLjlH9G4ECvy/hbpij3pQlibFzVVcqlhc63QUj5xdM9wQFK | |
RLw7paBNMZw9x0CxuFC7U4+iBfaMfo08ahzXDLLQe9Xfh68LOw+8awJVlfPwr6lTvllw | |
IhrbLEYzcB1KO83jpeeNW+QVmLyVM8KakhafmvRyqKhGFZohEwXhM5mzQUuGHoCpMoAg | |
htzqlt0s2ceY39mLZmt05ajpe5pQ38icuULDw42829Il7tWhhxYewrDjYI3OlLRHN4DR | |
DeYeSDqrciznCk4k4y0vnH6xd6FXPMpWya4KPDsqhhpQeqxihwW8NvfjZ7Nm0T7PV0w+ | |
xHBQ== | |
X-Gm-Message-State: | ALoCoQnYe+zTkoTmfvW9gOSdzknElVG668fRxlDtq1oZdfgSXXqfN5BF7kgUI5cw+yMTOR3PGJrehbMdVgErIjP7PwGp74efSA== |
MIME-Version: | 1.0 |
X-Received: | by 10.194.173.233 with SMTP id bn9mr21795138wjc.1.1453094296548; |
Sun, 17 Jan 2016 21:18:16 -0800 (PST) | |
In-Reply-To: | <569C130C.4090706@prochac.sk> |
References: | <CAC4O8c9eSvBVJ0oj17Tv+HFqSU3k3KAF2qjDi8S3B+ayqQx_6w AT mail DOT gmail DOT com> |
<201601170055 DOT u0H0to54024329 AT envy DOT delorie DOT com> | |
<CAC4O8c8piNdZD2R=9BOu5Rw2u584jY4J1wAREZhu7rKu0h8xEg AT mail DOT gmail DOT com> | |
<569AF06E DOT 1010902 AT prochac DOT sk> | |
<CAC4O8c8kck08w9NuyhCoJC5pPK__Mt6KKUfZfcMdWM-q02tQ6g AT mail DOT gmail DOT com> | |
<569C130C DOT 4090706 AT prochac DOT sk> | |
Date: | Sun, 17 Jan 2016 20:18:16 -0900 |
Message-ID: | <CAC4O8c-B1+RkQ0gmbj+YD_Swq2n56FrAvYYTR7DbMTo-9WLMeA@mail.gmail.com> |
Subject: | Re: [geda-user] can we agree on a common start point for file format |
plugin stuff please | |
From: | "Britton Kerin (britton DOT kerin AT gmail DOT com) [via geda-user AT delorie DOT com]" <geda-user AT delorie DOT com> |
To: | geda-user AT delorie DOT com |
Reply-To: | geda-user AT delorie DOT com |
Errors-To: | nobody AT delorie DOT com |
X-Mailing-List: | geda-user AT delorie DOT com |
X-Unsubscribes-To: | listserv AT delorie DOT com |
--089e0122f0885eff40052994e144 Content-Type: text/plain; charset=UTF-8 On Sun, Jan 17, 2016 at 1:17 PM, Milan Prochac (milan AT prochac DOT sk) [via geda-user AT delorie DOT com] <geda-user AT delorie DOT com> wrote: > On 17. 1. 2016 22:12, Britton Kerin (britton DOT kerin AT gmail DOT com) [via > geda-user AT delorie DOT com] wrote: > >> >> I ran into a couple more small issues. You're probably already aware but >> here they are: >> >> * The untrue (failure) result from SavePCBWithFormat() seems totally >> ignored, it should really get an error popup or at the very least a log >> message since this is the case where your work isn't actually saved. I'm >> not sure if it could be handled at the SavePCBWithFormat() call points or >> if it would need to be further up. This isn't a problem with your branch, >> master has it too. But it might be easier to fix in your branch since it >> looks like you factored SavePCBWithFormat() into backup. We don' t want to >> fix it both places as would just make merge pain later >> >> > We should address this as separate issue and/or improvement. I do not > want change more than necessary of the original code as part of the feature > implementation. It makes review/testing/rollback easier. Probably a good policy. I put it in launchpad with a note that the intention is to fix it after modular formats are merged. > * It looks like SavePCB() and SavePCB2() are dead code now so should be >> removed. I like to put '// FIXME: I think I'm dead' by stuff like this but >> maybe you just remember >> >> > They are used by built-in PCB format plugin. SavePCB is function in > original PCB code and SavePCB2 is used to transform parameter list. > Currently these are the only functions which really save the PCB layout. Ah my bad cscope fail > * There's some scope to reduce the number of points that need to be edited >> in fftemplate.c. For example with the below only the first define value >> needs to change. >> >> #include <stdio.h> >> #define FORMAT_ID foo >> // Stringify the argument. Note that the argument isn't expanded. >> #define STRINGIFY(arg) #arg >> // First expand arg then STRINGIFY() it. >> #define EXPAND_AND_STRINGIFY(arg) STRINGIFY (arg) >> // Conctenate arg1 and arg2. Note that the arguments aren't >> expanded. >> #define CONCAT(arg1, arg2) arg1 ## arg2 >> // First expand arg1 and arg2, then concatenate the results. >> #define EXPAND_AND_CONCAT(arg1, arg2) CONCAT (arg1, arg2) >> #define FORMAT_ID_STRING EXPAND_AND_STRINGIFY (FORMAT_ID) >> #define FORMAT_FUNC(arg) EXPAND_AND_CONCAT (arg, FORMAT_ID) >> int >> FORMAT_FUNC (parse) (char *filename) >> { >> printf ( >> "I'm a " FORMAT_ID_STRING " parser parsing %s in %s!\n", >> filename, >> __func__ >> ); >> return 0; >> } >> int >> main (void) >> { >> (FORMAT_FUNC (parse)) ("file.foo"); >> return 0; >> } >> >> It's also a good idea to use use static functions for Parse Save etc. >> provided everything external goes through the pointers in HID_Format, in >> which case the function-name generating macro invocations are optional. >> >> > IMO the template is not the file which will be edited on daily basis, so > it is not worth too much effort. > Reasonable. We don't want a bunch of synonymous formats anyway of course, but ultimately it might be worth it since a number of loaders could exist. Britton --089e0122f0885eff40052994e144 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo= te">On Sun, Jan 17, 2016 at 1:17 PM, Milan Prochac (<a href=3D"mailto:milan= @prochac.sk">milan AT prochac DOT sk</a>) [via <a href=3D"mailto:geda-user AT delorie= .com">geda-user AT delorie DOT com</a>] <span dir=3D"ltr"><<a href=3D"mailto:ge= da-user AT delorie DOT com" target=3D"_blank">geda-user AT delorie DOT com</a>></span>= wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor= der-left:1px #ccc solid;padding-left:1ex"><span class=3D"">On 17. 1. 2016 2= 2:12, Britton Kerin (<a href=3D"mailto:britton DOT kerin AT gmail DOT com" target=3D"_= blank">britton DOT kerin AT gmail DOT com</a>) [via <a href=3D"mailto:geda-user AT delori= e.com" target=3D"_blank">geda-user AT delorie DOT com</a>] wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> <br> I ran into a couple more small issues. You're probably already aware bu= t here they are:<br> <br> * The untrue (failure) result from SavePCBWithFormat() seems totally ignore= d, it should really get an error popup or at the very least a log message s= ince this is the case where your work isn't actually saved.=C2=A0 I'= ;m not sure if it could be handled at the SavePCBWithFormat() call points o= r if it would need to be further up.=C2=A0 This isn't a problem with yo= ur branch, master has it too.=C2=A0 But it might be easier to fix in your b= ranch since it looks like you factored SavePCBWithFormat() into backup.=C2= =A0 We don' t want to fix it both places as would just make merge pain = later<br> <br> </blockquote> <br></span> We should address this as separate issue and/or improvement.=C2=A0 I do not= want change more than necessary of the original code as part of the featur= e implementation. It makes review/testing/rollback easier.</blockquote><div= ><br></div><div style=3D"">Probably a good policy.=C2=A0 I put it in launch= pad with a note that the intention is to fix it after modular formats are m= erged.=C2=A0</div><div>=C2=A0</div><blockquote class=3D"gmail_quote" style= =3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span cl= ass=3D""> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> * It looks like SavePCB() and SavePCB2() are dead code now so should be rem= oved.=C2=A0 I like to put '// FIXME: I think I'm dead' by stuff= like this but maybe you just remember<br> <br> </blockquote> <br></span> They are used by built-in PCB format plugin. SavePCB is function in origina= l PCB code and SavePCB2=C2=A0 is used to transform parameter list. Currentl= y these are the only functions which really save the PCB layout.</blockquot= e><div><br></div><div style=3D"">Ah my bad cscope fail</div><div><br></div>= <div>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8= ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"h5"> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> * There's some scope to reduce the number of points that need to be edi= ted in fftemplate.c.=C2=A0 For example with the below only the first define= value needs to change.<br> <br> =C2=A0 =C2=A0 =C2=A0#include <stdio.h><br> =C2=A0 =C2=A0 =C2=A0#define FORMAT_ID foo<br> =C2=A0 =C2=A0 =C2=A0// Stringify the argument.=C2=A0 Note that the argument= isn't expanded.<br> =C2=A0 =C2=A0 =C2=A0#define STRINGIFY(arg) #arg<br> =C2=A0 =C2=A0 =C2=A0// First expand arg then STRINGIFY() it.<br> =C2=A0 =C2=A0 =C2=A0#define EXPAND_AND_STRINGIFY(arg) STRINGIFY (arg)<br> =C2=A0 =C2=A0 =C2=A0// Conctenate arg1 and arg2.=C2=A0 Note that the argume= nts aren't expanded.<br> =C2=A0 =C2=A0 =C2=A0#define CONCAT(arg1, arg2) arg1 ## arg2<br> =C2=A0 =C2=A0 =C2=A0// First expand arg1 and arg2, then concatenate the res= ults.<br> =C2=A0 =C2=A0 =C2=A0#define EXPAND_AND_CONCAT(arg1, arg2) CONCAT (arg1, arg= 2)<br> =C2=A0 =C2=A0 =C2=A0#define FORMAT_ID_STRING EXPAND_AND_STRINGIFY (FORMAT_I= D)<br> =C2=A0 =C2=A0 =C2=A0#define FORMAT_FUNC(arg) EXPAND_AND_CONCAT (arg, FORMAT= _ID)<br> =C2=A0 =C2=A0 =C2=A0int<br> =C2=A0 =C2=A0 =C2=A0FORMAT_FUNC (parse) (char *filename)<br> =C2=A0 =C2=A0 =C2=A0{<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0printf (<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0"I'm a " FORMAT_ID_S= TRING " parser parsing %s in %s!\n",<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0filename,<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0__func__<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;<br> =C2=A0 =C2=A0 =C2=A0}<br> =C2=A0 =C2=A0 =C2=A0int<br> =C2=A0 =C2=A0 =C2=A0main (void)<br> =C2=A0 =C2=A0 =C2=A0{<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0(FORMAT_FUNC (parse)) ("file.foo");<br= > =C2=A0 =C2=A0 =C2=A0 =C2=A0return 0;<br> =C2=A0 =C2=A0 =C2=A0}<br> <br> It's also a good idea to use use static functions for Parse Save etc. p= rovided everything external goes through the pointers in HID_Format, in whi= ch case the function-name generating macro invocations are optional.<br> <br> </blockquote> <br></div></div> IMO the template is not the file which will be edited on daily basis, so it= is not worth too much effort.<br></blockquote><div><br></div><div style=3D= "">Reasonable.=C2=A0 We don't want a bunch of synonymous formats anyway= of course, but ultimately it might be worth it since a number of loaders c= ould exist.</div><div>=C2=A0</div><div style=3D"">Britton</div><div><br></d= iv></div></div></div> --089e0122f0885eff40052994e144--
webmaster | delorie software privacy |
Copyright © 2019 by DJ Delorie | Updated Jul 2019 |