# Re: bug in sanei_debug.h

From: Petter Reinholdtsen (pere@hungry.com)
Date: Tue Oct 17 2000 - 03:12:23 PDT

- Next message: Jaeger, Gerhard: "Re: Problems with saned/net backend"
  - Previous message: Petter Reinholdtsen: "Re: sane as a server to Windows clients?"
  - Maybe in reply to: Jochen Eisinger: "bug in sanei_debug.h"
  - Next in thread: Jochen Eisinger: "Re: bug in sanei_debug.h"
  - Reply: Jochen Eisinger: "Re: bug in sanei_debug.h"
  - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

  [Jochen Eisinger]
  > I've patch sanei_debug.h... now it creates one additional function
  > for each backend that #includes sanei_debug.h (if there is no
  > support for vararg macros). The output is the same as if it was
  > compiled with vararg macros.

  I suggest removing the vararg macro implementation if the new one
  works equally well. It would be very nice to have portable code in
  the debug functions.

  > * debug_msg is no more static (maybe it should be renamed
  > sanei_debug_msg to avoid conflicts)

  Good idea.

  > * the new per backend function needs to #include stdlib, string & stdarg

  Is this really a problem?

  > * it allocates memory

  This can be avoided by changing the arguments to debug_msg() to
  inclued the backend name as well:

  debug_msg (level, DBG_LEVEL, STRINGIFY(BACKEND_NAME), msg, ap);

  Then the output can be printed with two vfprintf() calls unless stderr
  is a socket. If it is a socket, I guess there is no other way to make
  sure all the info is included in the syslog message but to allocate
  some memory. :-/

  Why did you not make the DBG_LOCAL function static? I believe it
  should be.

      --
      ##>  Petter Reinholdtsen  <##  |  pere@td.org.uit.no
      --
      Source code, list archive, and docs: http://www.mostang.com/sane/
      To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com

  - Next message: Jaeger, Gerhard: "Re: Problems with saned/net backend"
  - Previous message: Petter Reinholdtsen: "Re: sane as a server to Windows clients?"
  - Maybe in reply to: Jochen Eisinger: "bug in sanei_debug.h"
  - Next in thread: Jochen Eisinger: "Re: bug in sanei_debug.h"
  - Reply: Jochen Eisinger: "Re: bug in sanei_debug.h"
  - Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

  This archive was generated by hypermail 2b29 : Tue Oct 17 2000 - 03:04:14 PDT