Re: External App connection to a GnuCash file

2007-09-03 Thread Daniel Espinosa
2007/9/2, Christian Stimming [EMAIL PROTECTED]:
 Am Mittwoch, 29. August 2007 21:52 schrieb Josh Sled:
  Daniel Espinosa [EMAIL PROTECTED] writes:
   I found a macro in /macros/legacy_macros.m4 witch test for sscanf to
   support %lld (long long decimal integer) if so defines HAVE_SCANF_LLD.
   I think this is supported in recent gcc versions, then I can safetly
   define it in configure.in or remove this test in
   /lib/libqof/qof/qofutil.h.
 
  I'm not 100% sure about the provenance of that code, but I'm pretty sure it
  should not be removed.

 Josh is correct. The macro from legacy_macros.m4 turned out to be not legacy
 at all, but it is in fact needed a lot. To be more precise, the gcc/libc
 environment on Windows/mingw needs a different scanf() format character for
 LLD than what gcc needs on Linux. The test in legacy_macros.m4 checks exactly
 that. Hence, you need to copy the respective macro into your own application
 as well.


Thanks I've copied this macros in my project and it now compiles.

 On the other hand, the resulting format character itself is probably only
 needed inside the gnucash/gncqof implementation and doesn't have to be
 exposed to outside applications. Hence, in the long term this test probably
 should have to be done by your external application, and in gnucash this
 #ifdef check should be moved to an internal header file. Well, that's a
 long-term goal.



Scanf is used in file backend and other places inside GnuCash, then
this tests,  I think, could be hide at the eyes of other applications
and just expose the usefull API for other applications.

Why is a long-term goal?

Is it represent too much work?

When will GC clean up this issues to make easy other applications to
use its data, may be to 2.4 or 3.0?



-- 
Trabajar, la mejor arma para tu superación
de grano en grano, se hace la arena (R) (entrámite, pero para los
cuates: LIBRE)

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-09-03 Thread Christian Stimming
Am Montag, 3. September 2007 20:16 schrieb Daniel Espinosa:
  On the other hand, the resulting format character itself is probably only
  needed inside the gnucash/gncqof implementation and doesn't have to be
  exposed to outside applications. Hence, in the long term this test
  probably should have to be done by your external application, and in
  gnucash this #ifdef check should be moved to an internal header file.
  Well, that's a long-term goal.

 Scanf is used in file backend and other places inside GnuCash, then
 this tests,  I think, could be hide at the eyes of other applications
 and just expose the usefull API for other applications.

Yes. Derek and I already agreed on this.

 Why is a long-term goal?

Because it's not important for *gnucash*, hence it isn't a short-term goal 
*for gnucash*.

 Is it represent too much work?

Yes. Unless you send in a patch - feel free to do so.

 When will GC clean up this issues to make easy other applications to
 use its data, may be to 2.4 or 3.0?

No idea.

Christian
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-09-02 Thread Christian Stimming
Am Mittwoch, 29. August 2007 21:52 schrieb Josh Sled:
 Daniel Espinosa [EMAIL PROTECTED] writes:
  I found a macro in /macros/legacy_macros.m4 witch test for sscanf to
  support %lld (long long decimal integer) if so defines HAVE_SCANF_LLD.
  I think this is supported in recent gcc versions, then I can safetly
  define it in configure.in or remove this test in
  /lib/libqof/qof/qofutil.h.

 I'm not 100% sure about the provenance of that code, but I'm pretty sure it
 should not be removed.

Josh is correct. The macro from legacy_macros.m4 turned out to be not legacy 
at all, but it is in fact needed a lot. To be more precise, the gcc/libc 
environment on Windows/mingw needs a different scanf() format character for 
LLD than what gcc needs on Linux. The test in legacy_macros.m4 checks exactly 
that. Hence, you need to copy the respective macro into your own application 
as well.

On the other hand, the resulting format character itself is probably only 
needed inside the gnucash/gncqof implementation and doesn't have to be 
exposed to outside applications. Hence, in the long term this test probably 
should have to be done by your external application, and in gnucash this 
#ifdef check should be moved to an internal header file. Well, that's a 
long-term goal.

Christian
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-30 Thread Daniel Espinosa
2007/8/29, Derek Atkins [EMAIL PROTECTED]:
 Quoting Daniel Espinosa [EMAIL PROTECTED]:

   I found a some macros used in GnuCash's configure.in file, and I'll
   trying to add to my program in order to fix this error, does any know
   how can I do this?
 
  Copy the code from our configure.in into your configure.in.
 
 
  I have already copied the code from gnucash's configure.in, and the
  all the code in legacy_macros.m4 to my project, but for now I don't
  know how make this macros to be included in my project, I've added in
  Makefile.am at
 
  EXTRA_DIST = (...) macros/legacy_macros.m4
 
  but autogen.sh/configure don't find this definitions.
 
  Any sugestion?

 Do you call the SCANF_LLD_CHECK macro in your configure.in?

Yes.

 Do you tell autogen.sh to include the macros directory when running alocal?


Thanks now it include the macros :-)
Now configure and autogen loads the macros and checks for %lld (it say
'yes' it supports it), and add to config.h the lines:

/* Define if scanf supports %I64d conversions. */
/* #undef HAVE_SCANF_I64D */

/* Define if scanf supports %lld conversions. */
#define HAVE_SCANF_LLD 1

/* Define if scanf supports %qd conversions. */
/* #undef HAVE_SCANF_QD */

But again the preprocesor stops at the same point to say:

/usr/local/include/gnucash/qofutil.h:54:5: error: #error No scanf
format string is known for LLD. Fix your ./configure so that the
correct one is detected!

Any other sugestions? May I need to move this code to other place 8r()
Do you know where?


---
Trabajar, la mejor arma para tu superación
de grano en grano, se hace la arena (R) (entrámite, pero para los
cuates: LIBRE)

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-30 Thread Derek Atkins
Quoting Daniel Espinosa [EMAIL PROTECTED]:

[snip]
 But again the preprocesor stops at the same point to say:

 /usr/local/include/gnucash/qofutil.h:54:5: error: #error No scanf
 format string is known for LLD. Fix your ./configure so that the
 correct one is detected!

 Any other sugestions? May I need to move this code to other place 8r()
 Do you know where?

Do you #include config.h as the first thing in your .c file?

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-29 Thread Daniel Espinosa
2007/8/28, Josh Sled [EMAIL PROTECTED]:
 Daniel Espinosa [EMAIL PROTECTED] writes:
  Why I have an error message for the file
  /usr/local/include/gnucash/qofutil.h in the line:
 
  #   error No scanf format string is known for LLD. Fix your
  ../configure so that the correct one is detected!
 
  The actual code in qofutil.h file is:

 Did you include a config.h, which might define one of those
 HAVE_... values?  What/how are you building your sources?


I'm using Anjuta to create my test project. When I open config.h file,
I can see it is created by configure.in, as spected, then I need to
get this variable defined in configure.in.

I found a macro in /macros/legacy_macros.m4 witch test for sscanf to
support %lld (long long decimal integer) if so defines HAVE_SCANF_LLD.
I think this is supported in recent gcc versions, then I can safetly
define it in configure.in or remove this test in
/lib/libqof/qof/qofutil.h.


  What are the steps to open a Session/Book in QOF?

 Take a look at some of the test files.  Try
 src/backend/file/test/test-load-xml2.c


  I have the following code:

 I think that's roughly correct.


  Are there any Tutorial to use GnuCash's QOF?

 Not as such.  There's plenty of documentation in the code, and there's
 bunches of GnuCash code that uses QOF, of course.


Well as result of this test program, I'll try to add the missing
functions for GncBook and some documentation trying to keep as simple
as possible the process to load a book and close it.


-- 
Trabajar, la mejor arma para tu superación
de grano en grano, se hace la arena (R) (entrámite, pero para los
cuates: LIBRE)

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-29 Thread Josh Sled
Daniel Espinosa [EMAIL PROTECTED] writes:
 I found a macro in /macros/legacy_macros.m4 witch test for sscanf to
 support %lld (long long decimal integer) if so defines HAVE_SCANF_LLD.
 I think this is supported in recent gcc versions, then I can safetly
 define it in configure.in or remove this test in
 /lib/libqof/qof/qofutil.h.

I'm not 100% sure about the provenance of that code, but I'm pretty sure it
should not be removed.


 Well as result of this test program, I'll try to add the missing
 functions for GncBook and some documentation trying to keep as simple
 as possible the process to load a book and close it.

Which functions are missing?

-- 
...jsled
http://asynchronous.org/ - a=jsled; b=asynchronous.org; echo [EMAIL PROTECTED]


pgp5d8B2Wjb0z.pgp
Description: PGP signature
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-29 Thread Daniel Espinosa
2007/8/29, Josh Sled [EMAIL PROTECTED]:
 Daniel Espinosa [EMAIL PROTECTED] writes:
  I found a macro in /macros/legacy_macros.m4 witch test for sscanf to
  support %lld (long long decimal integer) if so defines HAVE_SCANF_LLD.
  I think this is supported in recent gcc versions, then I can safetly
  define it in configure.in or remove this test in
  /lib/libqof/qof/qofutil.h.

 I'm not 100% sure about the provenance of that code, but I'm pretty sure it
 should not be removed.


I found a some macros used in GnuCash's configure.in file, and I'll
trying to add to my program in order to fix this error, does any know
how can I do this?


  Well as result of this test program, I'll try to add the missing
  functions for GncBook and some documentation trying to keep as simple
  as possible the process to load a book and close it.

 Which functions are missing?


Just wait to finish my program and I'll give you the missing
funcitions I think could be there to make easy some others to use GC's
data through the backends (I don't want to talk more about becouse the
bug #470750 is marked as just a documentation bug not a  missing
feature )

-- 
Trabajar, la mejor arma para tu superación
de grano en grano, se hace la arena (R) (entrámite, pero para los
cuates: LIBRE)

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-29 Thread Josh Sled
Daniel Espinosa [EMAIL PROTECTED] writes:
 I found a some macros used in GnuCash's configure.in file, and I'll
 trying to add to my program in order to fix this error, does any know
 how can I do this?

Add them to your program's configure.in?  Or, if you don't need/want the
portability that auto* provides, just figure out what the correct HAVE_[...]
value for your machine is and add it to a manually-maintained config.h.

-- 
...jsled
http://asynchronous.org/ - a=jsled; b=asynchronous.org; echo [EMAIL PROTECTED]


pgpwCqmLZymir.pgp
Description: PGP signature
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-29 Thread Daniel Espinosa
2007/8/29, Derek Atkins [EMAIL PROTECTED]:
 Quoting Daniel Espinosa [EMAIL PROTECTED]:

  2007/8/29, Josh Sled [EMAIL PROTECTED]:
  Daniel Espinosa [EMAIL PROTECTED] writes:
   I found a macro in /macros/legacy_macros.m4 witch test for sscanf to
   support %lld (long long decimal integer) if so defines HAVE_SCANF_LLD.
   I think this is supported in recent gcc versions, then I can safetly
   define it in configure.in or remove this test in
   /lib/libqof/qof/qofutil.h.
 
  I'm not 100% sure about the provenance of that code, but I'm pretty sure it
  should not be removed.

 Indeed, it should not be removed.  Although we might want to move it into
 a more internal header instead of exposing it in the qof interface.
 But that's a discussion for a different day.

  I found a some macros used in GnuCash's configure.in file, and I'll
  trying to add to my program in order to fix this error, does any know
  how can I do this?

 Copy the code from our configure.in into your configure.in.


I have already copied the code from gnucash's configure.in, and the
all the code in legacy_macros.m4 to my project, but for now I don't
know how make this macros to be included in my project, I've added in
Makefile.am at

EXTRA_DIST = (...) macros/legacy_macros.m4

but autogen.sh/configure don't find this definitions.

Any sugestion?

   Well as result of this test program, I'll try to add the missing
   functions for GncBook and some documentation trying to keep as simple
   as possible the process to load a book and close it.
 
  Which functions are missing?
 
 
  Just wait to finish my program and I'll give you the missing
  funcitions I think could be there to make easy some others to use GC's
  data through the backends (I don't want to talk more about becouse the
  bug #470750 is marked as just a documentation bug not a  missing
  feature )

 Keep in mind that there IS no GNCBook.  GNCBook was migrated to QofBook.
 All the functions are qof_book_*.  The old gnc_book functions are
 deprecated wrappers.

 The old documentation you found is, well, old.. And wrong.  It was
 probably written before I started working on GnuCash in 1999, and
 it certainly has not been kept up to date since at LEAST GnuCash 1.4.
 Right now the current developer docs are available at:

   http://cvs.gnucash.org/docs/HEAD/


OK, I'll see it there.

-- 
Trabajar, la mejor arma para tu superación
de grano en grano, se hace la arena (R) (entrámite, pero para los
cuates: LIBRE)

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-29 Thread Derek Atkins
Quoting Daniel Espinosa [EMAIL PROTECTED]:

  I found a some macros used in GnuCash's configure.in file, and I'll
  trying to add to my program in order to fix this error, does any know
  how can I do this?

 Copy the code from our configure.in into your configure.in.


 I have already copied the code from gnucash's configure.in, and the
 all the code in legacy_macros.m4 to my project, but for now I don't
 know how make this macros to be included in my project, I've added in
 Makefile.am at

 EXTRA_DIST = (...) macros/legacy_macros.m4

 but autogen.sh/configure don't find this definitions.

 Any sugestion?

Do you call the SCANF_LLD_CHECK macro in your configure.in?
Do you tell autogen.sh to include the macros directory when running alocal?

-derek

-- 
   Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
   Member, MIT Student Information Processing Board  (SIPB)
   URL: http://web.mit.edu/warlord/PP-ASEL-IA N1NWH
   [EMAIL PROTECTED]PGP key available

___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel


Re: External App connection to a GnuCash file

2007-08-28 Thread Josh Sled
Daniel Espinosa [EMAIL PROTECTED] writes:
 Why I have an error message for the file
 /usr/local/include/gnucash/qofutil.h in the line:

 #   error No scanf format string is known for LLD. Fix your
 ../configure so that the correct one is detected!

 The actual code in qofutil.h file is:

Did you include a config.h, which might define one of those
HAVE_... values?  What/how are you building your sources?


 What are the steps to open a Session/Book in QOF?

Take a look at some of the test files.  Try
src/backend/file/test/test-load-xml2.c


 I have the following code:

I think that's roughly correct. 


 Are there any Tutorial to use GnuCash's QOF?

Not as such.  There's plenty of documentation in the code, and there's
bunches of GnuCash code that uses QOF, of course. 

-- 
...jsled
http://asynchronous.org/ - a=jsled; b=asynchronous.org; echo [EMAIL PROTECTED]


pgp5imQNqdJDH.pgp
Description: PGP signature
___
gnucash-devel mailing list
gnucash-devel@gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-devel