| Hi,
I wrote a week or so ago about detecting updates.
You mentioned that the best way is to make a new
callback and said you'd put it on your todo list.
I'm sure this todo list of yours is getting REALLY
long, so I tried to find where I could put such a call
back inside htsback.c and/or htscore.c. There are
other callbacks I could use as well, so I thought I
might try to understand the code a bit more. It is a
bit hard though, some functions are very long and hard
for me to follow and unfornately I don't know how to
read French (except menus :) So, after many hours I
made no real progress.
Anyway, I began to realise that a lot of info is
already in the log messages. There are 233 of these
and I thought it might be useful to have a single
callback for these rather than making any new
callbacks. Then an API user could parse these messages
for information and hints (This would actually solve
my 'update hint' problem, for example.) It would also
allow an API user to integrate your messages with
other messages, which could be very handy.
So far (as of version 3.08-3), you write to the logs
VERY consistently, so it would be easy to convert the
fprintf calls (and the fspc calls) to a couple of
functions which formats the string (using vprintf) and
then passes it to a callback before writing to the
log. I could write the functions and send them to you
if you don't have time, then, if you are willing, you
could do a simple search/replace and change your
fprintf calls that write to the log to the new ones. I
have checked your code very closely and you could
easily do this by replacing these three strings:
fprintf(opt
fprintf(httrack
fprintf(cache
Please let me know if this sounds acceptable to you
and I will send you the code (directly via e-mail,
because this form mangles lines) or I could apply the
changes directly to the next release if you would
prefer.
many thanks,
john
| |