#Xpr Lib Programming
6 messages in this thread
I am trying to write a telecomm program that uses the Xpr libraries. I
have two problems that are killing me.
1) What is the difference between the XprZmodem 2.0 and 2.1 libraries?
2.0 works fine for me, 2.1 crashes miserably. I've looked at the source
for both, and I'm still mystified as to why I can't get it to work. :-/
2) Is there any timing constraints on downloading with the XprXmodem
library? The same code that downloads fine with the 2.0 XprZmodem lib bombs
with the XprXmodem lib.
Thanks!!!
Kevin
Kev – "Outside of a dog, a book is Man's best friend."
"Inside of a dog, its too dark to read!" – Groucho Marx
Kevin,
Lots of people have reported problems with xprzmodem 2.1. However, I've
been running it (the '020 version) with no problems at all. I believe the
problems people are having is due to an incorrect implementation of the XPR
callbacks (only thing I can thing of since it works for some and not for
others). As I've found out the HARD way, timing in the callbacks is
critical (ie, use WaitIO(), not GetMsg()).
There is a known bug with 2.1, tho, that might bite you — don't set the
system time while 2.1 is active then try to do a file transfer — you'll
likely guru.
Steve, thanks for the tip about using WaitIO()! I'll check my code and see
how I'm doing it. The setting system time bug shouldn't be a problem. I
never set it. I might read it, but I'll never set it.
How would you suggest I implement the Xpr callbacks "correctly" ? I
implement the functions as and fill in the XPR_IO structure appropriately.
long __saveds __regargs xprfunctionname (void)
Any suggestions would be greatly appreciated! Sorry about not getting on
earlier and checking for mail, the past few weeks have been real hectic!
Kev – "Outside of a dog, a book is Man's best friend."
"Inside of a dog, its too dark to read!" – Groucho Marx
Kevin,
Here's an example of a call back (you're on the right track) …
long __saveds __asm xunlink(register __a0 char *filename) {
int status = 0;
status = remove(filename);
if (!status) {
return((long)status);
}
else {
return(-1L);
}
} /* xunlink */
Most of the callbacks are straight forward but a couple will make you pull
your hair out! (Took me until version 1.46 of Backtalk to get it all
right, and I'm still not positive it's right). XPR is great but the spec
leaves a lot to your imagination (and experimentation).
Kevin,
Almost forgot — yes, fill out the structure appropriately — any callback
you do not implement make sure you set that member to NULL in the
structure.
Thanks for the tips, Steve!! I'll let you know how everything works out!
BTW, for unlink, I just did the following:
long __saveds __regargs
xfunlink ( char *buf )
{
return ( DeleteFile ( buf ) );
}
I'll have to look at your example closely to see where I'm going wrong.
Thanks!
Kev – "Outside of a dog, a book is Man's best friend."
"Inside of a dog, its too dark to read!" – Groucho Marx