Application-specific context in ArgusParserStruct

Harry Bock harry at oshean.org
Wed Jun 3 22:29:42 EDT 2009


Hi Carter,

I've come across a little snag in developing Periscope; I'd like to store a
pointer to a mutable context relevant only to my application, without adding
more fields to ArgusParserStruct and without using global variables.  I've
noticed that a lot of the client-specific data structures are all stored
within ArgusParserStruct, but there is no "agnostic" field where I could
simply link in my own.

I've worked around this by saving my context in parser->RaFlowModel, which
I've verified does not get modified by any Argus client function that I'm
using, directly or indirectly.  In the future, however, I'd suggest adding a
simple field like so to ArgusParserStruct:

struct ArgusParserStruct {
  int status, ...;
  ...
+  void *context;
};

As Argus clients are currently linked statically to the common/event/parser
libraries, binary compatibility shouldn't be an issue, but you obviously
know the direction of Argus far better than I could, so I don't want to
change anything sensitive.  If the change is acceptable, could it be
included in the final release of argus-clients-3.0.1?

This change would also greatly help reduce clutter in ArgusParserStruct, as
you could move client-specific data (such as what is needed by radium,
rabins, rahisto, etc) out of common code and straight into the application.
I'd be more than happy to contribute the patches necessary to all of the
Argus clients, given a week or two.

-- 
Harry Bock
Software Developer, Package Maintainer
OSHEAN, Inc.
Email: harry at oshean.org
PGP Key ID: 546CC353
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist1.pair.net/pipermail/argus/attachments/20090603/afe95745/attachment.html>


More information about the argus mailing list