From: | David McMinn |
Date: | 19 Jan 2000 at 09:27:56 |
Subject: | Re: UDP Chat V2.7 |
Hi Anton
> Yes please that would be interesting- I'll be having separate memory
> areas for the variables for each program that accesses it- aka
> Mildred- so you'll have to give the address of that memory area as a
> parameter for the Functions- would that still be possible in C (well
> assuming it wouldn't be a pain of course).
Yes, thats how the OS libs work. e.g. ASL lib:
*asl_fr.FileRequest=AllocASLRequest_(...)
if *asl
if AslRequest_(*asl_fr,...)
; do whatever
End If
FreeAslRequest_ *asl_fr
end if
And at the risk of starting a riot:
struct UDPvars {
int dunno;
int address;
int etc;
}
struct UDPvars *allocudp(void) /* maybe have some tags? */
{
return((struct UDPvars *)AllocMem(sizeof(struct UDPvars),
MEMF_CLEAR|MEMF_ANY));
}
void freeudp(struct UDPvars *udp)
{
if(udp) FreeMem(udp, sizeof(struct UDPvars));
}
int connectudp(struct UDPvars *udp, int address)
{
if(udp)
{
udp->address = address;
/* do whatever else here, will affect only the copy
that the program has passed to your shared lib */
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: blitz-list-unsubscribe@netsoc.ucd.ie
For additional commands, e-mail: blitz-list-help@netsoc.ucd.ie