[concordance-devel] Patches: Windows build fixes

2008-03-30 Thread Stephen Warren
I built libconcord under Windows in preparation for testing congruity 
there, and found some issues. Attached are the fixes:


1) When I changed libconcord.h, I didn't update the Windows .def file. 
The attached concordance-win-def.patch does this.


2) Marco should comment on this:

Both libconcord_winhid and concordance (and possibly other Window 
projects I didn't build) attempt to link against odbc32.lib and 
odbccp32.lib. I don't have either of these in Visual C++ Express 2005. 
So, I removed them from the link line, and everything appears to link 
fine (have not tested execution yet). Hopefully, these libraries are 
there just because default projects are set up this way? Since ODBC is a 
database access library, I can't see why libconcord would need it... See 
attached concordance-win-odbc.patch (which should probably be expanded 
to the other vcproj files too)
Index: concordance/win/concordance.vcproj
===
RCS file: /cvsroot/concordance/concordance/concordance/win/concordance.vcproj,v
retrieving revision 1.4
diff -u -p -r1.4 concordance.vcproj
--- concordance/win/concordance.vcproj  26 Mar 2008 01:30:46 -  1.4
+++ concordance/win/concordance.vcproj  30 Mar 2008 06:32:11 -
@@ -1,7 +1,7 @@
 ?xml version=1.0 encoding=Windows-1252?
 VisualStudioProject
ProjectType=Visual C++
-   Version=8,00
+   Version=8.00
Name=concordance
ProjectGUID={472FC1A1-C379-4F65-AFD1-41996F052726}

@@ -160,7 +160,7 @@
/
Tool
Name=VCLinkerTool
-   AdditionalDependencies=./Debug/libconcord.lib 
ws2_32.lib odbc32.lib odbccp32.lib
+   AdditionalDependencies=./Debug/libconcord.lib 
ws2_32.lib
OutputFile=.\Debug/concordance.exe
LinkIncremental=2
SuppressStartupBanner=true
Index: libconcord/win/libconcord_winhid.vcproj
===
RCS file: 
/cvsroot/concordance/concordance/libconcord/win/libconcord_winhid.vcproj,v
retrieving revision 1.4
diff -u -p -r1.4 libconcord_winhid.vcproj
--- libconcord/win/libconcord_winhid.vcproj 26 Mar 2008 01:30:46 -  
1.4
+++ libconcord/win/libconcord_winhid.vcproj 30 Mar 2008 06:32:12 -
@@ -1,7 +1,7 @@
 ?xml version=1.0 encoding=Windows-1252?
 VisualStudioProject
ProjectType=Visual C++
-   Version=8,00
+   Version=8.00
Name=libconcord_winhid
ProjectGUID={0665485E-2249-4FD8-BE9C-CCC0C3BBF3A8}

@@ -72,7 +72,7 @@
/
Tool
Name=VCLinkerTool
-   AdditionalDependencies=ws2_32.lib odbc32.lib 
odbccp32.lib
+   AdditionalDependencies=ws2_32.lib 

OutputFile=Debug/libconcord_winhid/libconcord.dll
LinkIncremental=2
SuppressStartupBanner=true
Index: libconcord/win/libconcord.def
===
RCS file: /cvsroot/concordance/concordance/libconcord/win/libconcord.def,v
retrieving revision 1.5
diff -u -p -r1.5 libconcord.def
--- libconcord/win/libconcord.def   14 Mar 2008 05:01:26 -  1.5
+++ libconcord/win/libconcord.def   30 Mar 2008 06:32:12 -
@@ -68,11 +68,9 @@ read_config_from_remote
 write_config_to_remote
 read_config_from_file
 write_config_to_file
-verify_xml_config
 verify_remote_config
 erase_config
-find_config_binary_size
-find_config_binary_start
+find_config_binary
 
 ; SAFEMODE FIRMWARE INTERACTIONS
 ;
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] concordance configure question

2008-03-30 Thread Phil Dibowitz
Stephen Warren wrote:
 Phil Dibowitz wrote:
 Stephen Warren wrote:
 Is it possible to add a --with-libconcord=/path/to/it option to
 concordance's configure script?
 I'd be happy to. I gotta remember how to do that with autoconf, shouldn't be
 hard.

 Keep in mind that you won't be able to do --with-libconcord=../libconcord
 since it puts stuff in .libs - you'd have to do a make install into
 /tmp/libconcord or something, and then do --with-libconcord=/tmp/libconcord.

 The --with-something options to autoconf assume that dir/lib is where
 the library will be and dir/include is where the header files will be...
 
 Maybe we could also have a --with-developer-tree option that knows it's
 ../libconcord and .libs for LDFLAGS? I have no idea if that's
 hard/possible to do with autoconf or not.

I'm not sure I see the need for this non-standard option, it's only one more
command, 'make install' - you can install it into /tmp/test and not even
need root priveleges...

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Patches: Windows build fixes

2008-03-30 Thread Phil Dibowitz
Stephen Warren wrote:
 I built libconcord under Windows in preparation for testing congruity
 there, and found some issues. Attached are the fixes:
 
 1) When I changed libconcord.h, I didn't update the Windows .def file.
 The attached concordance-win-def.patch does this.

Applied, thanks.

 2) Marco should comment on this:
 
 Both libconcord_winhid and concordance (and possibly other Window
 projects I didn't build) attempt to link against odbc32.lib and
 odbccp32.lib. I don't have either of these in Visual C++ Express 2005.
 So, I removed them from the link line, and everything appears to link
 fine (have not tested execution yet). Hopefully, these libraries are
 there just because default projects are set up this way? Since ODBC is a
 database access library, I can't see why libconcord would need it... See
 attached concordance-win-odbc.patch (which should probably be expanded
 to the other vcproj files too)

This seems like a solid change to me. I'm going to go ahead and apply it and
we can revert it if need be.

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Patch: Fix GetTag issue due to ref v.s. ptr change

2008-03-30 Thread Phil Dibowitz
Stephen Warren wrote:
 GetTag has an issue because it checks whether found is NULL before
 assigning to it, but now it's a reference, so that check doesn't make
 sense, and this renders the found value invalid, which breaks a lot of
 things. The attached patch fixes this.

Applied, thanks.

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] New feature that we should probably have

2008-03-30 Thread Stephen Warren
Phil Dibowitz wrote:
 Stephen Warren wrote:
 I've sent the logs to you directly off-list, due to size.
 
 Thanks. A few questions - your tarball had log2 and log3 (with 3 being
 empty), but no log1 - was that on purpose? Also, is this writing a config,
 or firmware? It looks like config. Seems simple, though... TOO simple.

Write config.

When the USB sniffer starts up, it starts capturing log1, but
automatically creates a new log when you plug/replug the device, so log2
started when I actually plugged in the Harmony, and log3 due to the
reboot that the Logitech software does at the end of the programming.

My *suspicion* (which is purely a guess) is that libconcord attempts to
always acquire a ton of information at attach time, some of which may be
impossible to acquire if the config is invalid, but the Logitech
application probably only doesn't bother with getting all that info
(probably, a bunch of it is only useful for concordance -v -i, and not a
simple action like config programming?)

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Patches: Windows build fixes

2008-03-30 Thread Stephen Warren
Phil Dibowitz wrote:
 Stephen Warren wrote:
 Both libconcord_winhid and concordance (and possibly other Window
 projects I didn't build) attempt to link against odbc32.lib and
 odbccp32.lib. I don't have either of these in Visual C++ Express 2005.
 
 No apply:
 
 Hunk #1 FAILED at 1.
 Hunk #2 FAILED at 160.
 Hunk #1 FAILED at 1.
 Hunk #2 FAILED at 72.

Must be some CRLF/LF issue with CVS under Cygwin on Windows I guess.
I'll see if I can work up patch in a saner format. I need a separate
Windows machine instead of rebooting all the time...

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Patches: Windows build fixes

2008-03-30 Thread Stephen Warren

Stephen Warren wrote:

Phil Dibowitz wrote:

Stephen Warren wrote:

Both libconcord_winhid and concordance (and possibly other Window
projects I didn't build) attempt to link against odbc32.lib and
odbccp32.lib. I don't have either of these in Visual C++ Express 2005.

No apply:


It looks like CVS diffs from Windows won't apply on Linux, and 
vice-versa, due to end-of-line issues.


So, attached are:

1) I manually edited the files on Linux and made the patch there. 
Probably this will apply OK for you. However, I can't apply it on my 
Windows machine, so this patch is untested.


2) Verbatim copies of the 3 modified vcproj files that I have built on 
Windows just fine. You can just copy these over the top of the relevant 
files in your CVS tree and check in; it looks like this is how you get 
files from Marco anyway...


? concordance/.deps
? concordance/.libs
? concordance/Makefile
? concordance/Makefile.in
? concordance/aclocal.m4
? concordance/autom4te.cache
? concordance/concordance
? concordance/config.guess
? concordance/config.h
? concordance/config.h.in
? concordance/config.log
? concordance/config.status
? concordance/config.sub
? concordance/configure
? concordance/depcomp
? concordance/install-sh
? concordance/libtool
? concordance/ltmain.sh
? concordance/missing
? concordance/stamp-h1
? concordance/win/.concordance.vcproj.swp
? consnoop/USBLog2.txt
? consnoop/USBLog2.usblog
? consnoop/USBLog2.xml
? consnoop/USBLog3.txt
? consnoop/USBLog3.usblog
? consnoop/USBLog3.xml
? consnoop/consnoop
? consnoop/recovery.tbz2
? libconcord/.deps
? libconcord/.libs
? libconcord/Makefile
? libconcord/Makefile.in
? libconcord/aclocal.m4
? libconcord/autom4te.cache
? libconcord/binaryfile.lo
? libconcord/config.guess
? libconcord/config.h
? libconcord/config.h.in
? libconcord/config.log
? libconcord/config.status
? libconcord/config.sub
? libconcord/configure
? libconcord/depcomp
? libconcord/install-sh
? libconcord/libconcord.la
? libconcord/libconcord.lo
? libconcord/libtool
? libconcord/libusbhid.lo
? libconcord/ltmain.sh
? libconcord/missing
? libconcord/remote.lo
? libconcord/remote_z.lo
? libconcord/stamp-h1
? libconcord/usblan.lo
? libconcord/web.lo
? libconcord/win/.libconcord_libusb.vcproj.swp
? libconcord/win/.libconcord_winhid.vcproj.swp
Index: concordance/win/concordance.vcproj
===
RCS file: /cvsroot/concordance/concordance/concordance/win/concordance.vcproj,v
retrieving revision 1.4
diff -u -p -r1.4 concordance.vcproj
--- concordance/win/concordance.vcproj  26 Mar 2008 01:30:46 -  1.4
+++ concordance/win/concordance.vcproj  30 Mar 2008 19:03:22 -
@@ -69,7 +69,7 @@
/
Tool
Name=VCLinkerTool
-   
AdditionalDependencies=./Release/libconcord.lib ws2_32.lib odbc32.lib 
odbccp32.lib
+   
AdditionalDependencies=./Release/libconcord.lib ws2_32.lib
OutputFile=.\Release/concordance.exe
LinkIncremental=1
SuppressStartupBanner=true
@@ -160,7 +160,7 @@
/
Tool
Name=VCLinkerTool
-   AdditionalDependencies=./Debug/libconcord.lib 
ws2_32.lib odbc32.lib odbccp32.lib
+   AdditionalDependencies=./Debug/libconcord.lib 
ws2_32.lib
OutputFile=.\Debug/concordance.exe
LinkIncremental=2
SuppressStartupBanner=true
Index: libconcord/win/libconcord_libusb.vcproj
===
RCS file: 
/cvsroot/concordance/concordance/libconcord/win/libconcord_libusb.vcproj,v
retrieving revision 1.4
diff -u -p -r1.4 libconcord_libusb.vcproj
--- libconcord/win/libconcord_libusb.vcproj 26 Mar 2008 01:30:46 -  
1.4
+++ libconcord/win/libconcord_libusb.vcproj 30 Mar 2008 19:03:22 -
@@ -72,7 +72,7 @@
/
Tool
Name=VCLinkerTool
-   AdditionalDependencies=ws2_32.lib odbc32.lib 
odbccp32.lib
+   AdditionalDependencies=ws2_32.lib

OutputFile=Release/libconcord_libusb/libconcord.dll
LinkIncremental=1
SuppressStartupBanner=true
@@ -169,7 +169,7 @@
/
Tool
Name=VCLinkerTool
-   AdditionalDependencies=ws2_32.lib odbc32.lib 
odbccp32.lib
+   AdditionalDependencies=ws2_32.lib

OutputFile=Debug/libconcord_libusb/libconcord.dll

[concordance-devel] new debug() macro

2008-03-30 Thread Phil Dibowitz
I'm not sure how many of you are on the commit list, but for those of you
who aren't, I've converted all our various #ifdef debug statements to a new
macro called debug() that does the same thing and vastly cleans up the code.

Even better, it prints all debug messages in this format:

  DEBUG (function): message\n

and always to stderr.

Which means:
  * debug messages are easier to spot, grep, or redirect
  * we always know what function the message is from
  * they're always in the same format
  * the user doesn't have to worry about newlines

Of course, getting tid of the tons of #ifdefs is good too.

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Suggestion for some cleanup in libconcord.cpp

2008-03-30 Thread Phil Dibowitz
Andreas Schulz wrote:
 On Wednesday 26 March 2008, Phil Dibowitz wrote:
 Your patch looks very solid. However, your changing things that Stephen's
 API patch is ALSO going to change (in fact, his patch will make your patch
 simpler, you won't have to deal with that silly static-size vs dynamic-size
 thing).
 Can you wait until his patch is applied and then fix up yours accordingly?
 
 No problem, it will be a few days anyway before I will have time to dig
 into the CVS again - I'll see what's left then...

Andreas,

Now that Stephen's patch has been merged, did you want to re-submit your
patch against the latest CVS? In theory it should make your patch a bit
smaller...

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Bug 1898492 - no one else affected, or just not interested?

2008-03-30 Thread Phil Dibowitz
Phil Dibowitz wrote:
 Didn't see you'd attached a patch. I *really* need to write a submitting
 patches doc.

 I just read your description, and it sounds pretty spot-on. I'll make a note
 to look at this as well, though I prefer patches be sent to the list, just 
 FYI.
 
 Looking at your patch, I have a few comments:
 
 1. It's generated against 0.13, but CVS has changed DRASTICALLY since then -
 can you please re-gen against CVS, and also check our new SubmittingPatches
 file for further details.
 
 2. It looks like you're right - RESPONSE_DONE should only be received after
 we send COMMAND_STOP_IRCAP, and by reading, we can flush that. Nice catch.
 
 3. Why do you comment out the 'else if (r == RESPONSE_DONE) {' ? While we
 shouldn't get this in the middle of things, it's certainly bad if we do, and
 a good reason to stop - I'd prefer we leave that check in.
 
 4. Can you add braces to your outer iff statement for me?
 
 If you could re-submit a patch (to the list, please), with the above
 changes, I'd appreciate it. The idea behind the patch looks solid to me.

Andreas,

I never saw you re-submit this patch - did I miss it?

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


[concordance-devel] Build failure with latest CVS

2008-03-30 Thread Stephen Warren
Latest libconcord.h contains:

static inline void debug(const char *str) {}

This causes a build failure because inline isn't a valid keyword in
standard ANSI C. Simply removing inline seems to fix the problem.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Build failure with latest CVS

2008-03-30 Thread Stephen Warren
Phil Dibowitz wrote:
 Stephen Warren wrote:
 Latest libconcord.h contains:

 static inline void debug(const char *str) {}

 This causes a build failure because inline isn't a valid keyword in
 standard ANSI C. Simply removing inline seems to fix the problem.
 
 Already fixed...

I still get this:

gcc -DHAVE_CONFIG_H -I.-Wall -ansi -pedantic-errors -ggdb
-I../libconcord -MT concordance-concordance.o -MD -MP -MF
.deps/concordance-concordance.Tpo -c -o concordance-concordance.o `test
-f 'concordance.c' || echo './'`concordance.c
In file included from concordance.c:21:
../libconcord/libconcord.h:47:19: error: anonymous variadic macros were
introduced in C99

[EMAIL PROTECTED] concordance]$ gcc --version
gcc (GCC) 4.1.2 20070925 (Red Hat 4.1.2-33)
(Fedora 8 with all updates)

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Build failure with latest CVS

2008-03-30 Thread Stephen Warren
Stephen Warren wrote:
 Phil Dibowitz wrote:
 Stephen Warren wrote:
 Latest libconcord.h contains:

 static inline void debug(const char *str) {}

 This causes a build failure because inline isn't a valid keyword in
 standard ANSI C. Simply removing inline seems to fix the problem.
 Already fixed...
 
 I still get this:
 
 ../libconcord/libconcord.h:47:19: error: anonymous variadic macros were
 introduced in C99

This, and the missing strdup prototype, are both direct fallouts of
using the -ansi -pedantic-errors compiler flags.

We only do this to ensure we don't use C99 constructs, so we can build
with Microsoft compilers that don't support C99.

I propose we replace -ansi -pedantic-errors with -std=c99. I believe
we can solve any subsequent Windows build problems by forcing
concordance.c to be built as C++ instead of C when compiling on Windows,
since most of C99 is in C++.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Build failure with latest CVS

2008-03-30 Thread Stephen Warren
Stephen Warren wrote:
 I propose we replace -ansi -pedantic-errors with -std=c99.

Sorry, just remove -ansi -pedantic-errors and don't add -std=c99;
the variadic macro works with -std=c99, but the strdup prototype still
isn't present unless we just remove all the standard-selection options.

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Firmware Upgrade 525

2008-03-30 Thread Stefan Arndt
Hello,

applied patch to latest cvs tree.

localhost:/home/arndt/Documents/concordance/concordance # concordance -F 
firmware.EZUp
Concordance 0.13+CVS
Copyright 2007 Kevin Timmerman and Phil Dibowitz
This software is distributed under the GPLv3.

DEBUG (FindRemote): bNumEndpoints 2
DEBUG (check_ep): address 81 attrib 03 max_length 64
DEBUG (check_ep): address 02 attrib 03 max_length 64
Requesting Identity: 100% done
DEBUG (prep_firmware): in prep firmware
DEBUG (prep_firmware): in prep firmware for firmware_update_base == 
firmware_base
DEBUG (prep_firmware): about to restartconfig
DEBUG (prep_firmware): done restarting config
DEBUG (prep_firmware): about to write-flash
DEBUG (HID_ReadReport): Failed to read from device: -110 (could not detach 
kernel driver from interface 0: No data available)
Failed to prepare remote for FW update
Failed to upload firmware: Unknown error
Failed with error 1
Press enter key to exit

Regards

Stefan
-- 
Psst! Geheimtipp: Online Games kostenlos spielen bei den GMX Free Games! 
http://games.entertainment.gmx.net/de/entertainment/games/free

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


[concordance-devel] Patch Python bindings for libconcord

2008-03-30 Thread Stephen Warren
Phil,

Attached is a file that exposes Python bindings for libconcord, up to
date with the latest CVS, and (partially) tested using congruity.

I propose we place it into libconcord/bindings/python/libconcord.py.

Unfortunately, I can't send a cvs diff, because I can't cvs add the file
because I don't have write access to the repository, and even the -N
option to cvs diff will only see cvs add'd files!

Re: The license. I suppose since this file is essentially derived from
libconcord.h, it must be GPL 3? If so, are you OK with it being LGPL 3
instead of full GPL 3, to allow non-GPL applications to use it? Either
way, feel free to replace the license header as needed for you to commit it.

Hopefully if the file is in the concordance repository, changes to
libconcord.h will be reflected there too (or at least, I'll send you
patches before header updates make it into an official release.)

# This code NOT copyright Stephen Warren [EMAIL PROTECTED]
# This code is released into the public domain.

from ctypes import *
import platform
import sys

# Internal DLL handle
if platform.system() == 'Windows':
_dll = cdll.LoadLibrary('libconcord.dll')
else:
_dll = cdll.LoadLibrary('libconcord.so.0')

# This exception may be raised by any function that returns an LC_ERROR_*.
class LibConcordException(Exception):
def __init__(self, func, result):
self.func = func
self.result = result
try:
self.result_str = c_char_p(_dll.lc_strerror(c_int(self.result))).value
except:
self.result_str = 'Unknown'

def __str__(self):
return 'libconcord function %s failed with error code %s (%s)' % (
repr(self.func),
repr(self.result),
repr(self.result_str)
)

# Internal function result checking functionality
class _CheckRetCode(object):
def __init__(self, func_name):
self.func_name = func_name

def __call__(self, *args):
result = args[0]
if result != 0:
raise LibConcordException(self.func_name, result)

# Internal ctypes function wrapper creation
def _create_func(
func_name,
error_checker,
*args
):
ftype = CFUNCTYPE(*args)
f = ftype((func_name, _dll))
if error_checker:
f.errcheck = error_checker(func_name)
return f

# typedef void (*lc_callback)(uint32_t, uint32_t, uint32_t, void*);
callback_type = CFUNCTYPE(None, c_uint, c_uint, c_uint, py_object)

# const char *get_mfg();
get_mfg = _create_func(
'get_mfg',
None,
c_char_p
)

# const char *get_model();
get_model = _create_func(
'get_model',
None,
c_char_p
)

# const char *get_codename();
get_codename = _create_func(
'get_codename',
None,
c_char_p
)

# int get_skin();
get_skin = _create_func(
'get_skin',
None,
c_int
)

# int get_fw_ver_maj();
get_fw_ver_maj = _create_func(
'get_fw_ver_maj',
None,
c_int
)

# int get_fw_ver_min();
get_fw_ver_min = _create_func(
'get_fw_ver_min',
None,
c_int
)

# int get_fw_type();
get_fw_type = _create_func(
'get_fw_type',
None,
c_int
)

# int get_hw_ver_maj();
get_hw_ver_maj = _create_func(
'get_hw_ver_maj',
None,
c_int
)

# int get_hw_ver_min();
get_hw_ver_min = _create_func(
'get_hw_ver_min',
None,
c_int
)

# int get_flash_size();
get_flash_size = _create_func(
'get_flash_size',
None,
c_int
)

# int get_flash_mfg();
get_flash_mfg = _create_func(
'get_flash_mfg',
None,
c_int
)

# int get_flash_id();
get_flash_id = _create_func(
'get_flash_id',
None,
c_int
)

# const char *get_flash_part_num();
get_flash_part_num = _create_func(
'get_flash_part_num',
None,
c_char_p
)

# int get_arch();
get_arch = _create_func(
'get_arch',
None,
c_int
)

# int get_proto();
get_proto = _create_func(
'get_proto',
None,
c_int
)

# const char *get_hid_mfg_str();
get_hid_mfg_str = _create_func(
'get_hid_mfg_str',
None,
c_char_p
)

# const char *get_hid_prod_str();
get_hid_prod_str = _create_func(
'get_hid_prod_str',
None,
c_int
)

# int get_hid_irl();
get_hid_irl = _create_func(
'get_hid_irl',
None,
c_int
)

# int get_hid_orl();
get_hid_orl = _create_func(
'get_hid_orl',
None,
c_int
)

# int get_hid_frl();
get_hid_frl = _create_func(
'get_hid_frl',
None,
c_int
)

# int get_usb_vid();
get_usb_vid = _create_func(
'get_usb_vid',
None,
c_int
)

# int get_usb_pid();
get_usb_pid = _create_func(
'get_usb_pid',
None,
c_int
)

# int get_usb_bcd();
get_usb_bcd = _create_func(
'get_usb_bcd',
None,
c_int
)

SERIAL_COMPONENT_1 = 1
SERIAL_COMPONENT_2 = 2
SERIAL_COMPONENT_3 = 3

# char *get_serial(int p);
get_serial = _create_func(
'get_serial',
None,
c_char_p,
c_int
)

# int get_config_bytes_used();
get_config_bytes_used = _create_func(
'get_config_bytes_used',
None,
c_int
)

# int 

Re: [concordance-devel] Build failure with latest CVS

2008-03-30 Thread Phil Dibowitz
Stephen Warren wrote:
 Stephen Warren wrote:
 I propose we replace -ansi -pedantic-errors with -std=c99.
 
 Sorry, just remove -ansi -pedantic-errors and don't add -std=c99;
 the variadic macro works with -std=c99, but the strdup prototype still
 isn't present unless we just remove all the standard-selection options.

Nope, -ansi is an alias for -std=c99 which DOES NOT error on stuff like
variables not at the top. -pedantic-errors is required.

I don't get the macro error that you do:

[EMAIL PROTECTED] concordance]$ make
make  all-am
make[1]: Entering directory `/home/phil/build/cvs/concordance/concordance'
gcc -DHAVE_CONFIG_H -I.-Wall -ansi -pedantic-errors -g -O2 -MT
concordance-concordance.o -MD -MP -MF .deps/concordance-concordance.Tpo -c
-o concordance-concordance.o `test -f 'concordance.c' || echo './'`concordance.c
concordance.c: In function 'parse_options':
concordance.c:589: warning: implicit declaration of function 'strdup'
mv -f .deps/concordance-concordance.Tpo .deps/concordance-concordance.Po
/bin/sh ./libtool --tag=CC   --mode=link gcc -Wall -ansi -pedantic-errors -g
-O2 -lconcord  -o concordance concordance-concordance.o
mkdir .libs
gcc -Wall -ansi -pedantic-errors -g -O2 -o concordance
concordance-concordance.o  /usr/lib/libconcord.so
make[1]: Leaving directory `/home/phil/build/cvs/concordance/concordance'


-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Firmware Upgrade 525

2008-03-30 Thread Phil Dibowitz
Stefan Arndt wrote:
 Hello,
 
 applied patch to latest cvs tree.

OK, this is helpful.

Reverse that patch (patch -p0 -R  libconcord-fw-debug.patch) and apply this
new one (same URL):

  http://www.phildev.net/concordance/libconcord-fw-debug.patch

Either we need to wait a bit after to se a RestartConfig(), or we need to
re-find the remote. I suspect it's just that we need to wait, so that's what
this patch does.

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Build failure with latest CVS

2008-03-30 Thread Stephen Warren
Phil Dibowitz wrote:
 Stephen Warren wrote:
 Stephen Warren wrote:
 I propose we replace -ansi -pedantic-errors with -std=c99.
 Sorry, just remove -ansi -pedantic-errors and don't add -std=c99;
 the variadic macro works with -std=c99, but the strdup prototype still
 isn't present unless we just remove all the standard-selection options.
 
 Nope, -ansi is an alias for -std=c99 which DOES NOT error on stuff like
 variables not at the top. -pedantic-errors is required.

-ansi is NOT -std=c99. ANSI C (1989) was standardized way before C99
(1999). See the build logs below. See
http://en.wikipedia.org/wiki/C_%28programming_language%29


[EMAIL PROTECTED] concordance]$ gcc -DHAVE_CONFIG_H -I.-Wall -ansi
-pedantic-errors -ggdb -I../libconcord -MT concordance-concordance.o -MD
-MP -MF .deps/concordance-concordance.Tpo -c -o
concordance-concordance.o concordance.c
In file included from concordance.c:21:
../libconcord/libconcord.h:47:19: error: anonymous variadic macros were
introduced in C99
concordance.c: In function ‘parse_options’:
concordance.c:589: warning: implicit declaration of function ‘strdup’


[EMAIL PROTECTED] concordance]$ gcc -DHAVE_CONFIG_H -I.-Wall -std=c99
-pedantic-errors -ggdb -I../libconcord -MT concordance-concordance.o -MD
-MP -MF .deps/concordance-concordance.Tpo -c -o
concordance-concordance.o concordance.c
concordance.c: In function ‘parse_options’:
concordance.c:589: warning: implicit declaration of function ‘strdup’

-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace
___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Build failure with latest CVS

2008-03-30 Thread Phil Dibowitz
Stephen Warren wrote:
 Phil Dibowitz wrote:
 Stephen Warren wrote:
 Stephen Warren wrote:
 I propose we replace -ansi -pedantic-errors with -std=c99.
 Sorry, just remove -ansi -pedantic-errors and don't add -std=c99;
 the variadic macro works with -std=c99, but the strdup prototype still
 isn't present unless we just remove all the standard-selection options.
 Nope, -ansi is an alias for -std=c99 which DOES NOT error on stuff like
 variables not at the top. -pedantic-errors is required.
 
 -ansi is NOT -std=c99. ANSI C (1989) was standardized way before C99
 (1999). See the build logs below. See
 http://en.wikipedia.org/wiki/C_%28programming_language%29

Sorry, I meant -ansi is the same as -std=c89:

From gcc(1):
   c89
   iso9899:1990
   ISO C90 (same as -ansi).

And again, you missed what I said about declarations not at the top. This is
why we use -ansi -pedantic-errors:

[EMAIL PROTECTED] tmp]$ gcc -std=c99 foo.c
[EMAIL PROTECTED] tmp]$ gcc -std=c99 -pedantic-errors foo.c
[EMAIL PROTECTED] tmp]$ gcc -ansi -pedantic-errors foo.c
foo.c: In function 'main':
foo.c:9: error: ISO C90 forbids mixed declarations and code
[EMAIL PROTECTED] tmp]$

It's the ONLY combination that seems to catch that error.

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel


Re: [concordance-devel] Firmware Upgrade 525

2008-03-30 Thread Phil Dibowitz
Stefan Arndt wrote:
 Hello,
 
 reversed patch and patched again.
 It took longer but failed.

Taking longer is expected, there was a 10-second sleep in there.

OK, I uploaded a patch that will attempt to re-init the harmony after the
config reset (which I wouldn't think is necessary based on the data at hand,
but it's worth a shot).

Give it a shot and let me know.

-- 
Phil Dibowitz [EMAIL PROTECTED]
Open Source software and tech docsInsanity Palace of Metallica
http://www.phildev.net/   http://www.ipom.com/

Never write it in C if you can do it in 'awk';
 Never do it in 'awk' if 'sed' can handle it;
 Never use 'sed' when 'tr' can do the job;
 Never invoke 'tr' when 'cat' is sufficient;
 Avoid using 'cat' whenever possible -- Taylor's Laws of Programming




signature.asc
Description: OpenPGP digital signature
-
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://ad.doubleclick.net/clk;164216239;13503038;w?http://sf.net/marketplace___
concordance-devel mailing list
concordance-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/concordance-devel