[ANet-devel] Re: File Management questions
Status: Abandoned
Brought to you by:
benad
|
From: Benoit N. <be...@ma...> - 2001-12-19 15:10:11
|
>I am not sure how ANetMemoryTag works. I don't think it's possible to
>GetMemoryBlockSize() on a pointer and find out, how much memory was
>allocated to it. If ANetMemoryTag was a struct of type:
>{ void *ptr; int size; }, then it would work; ie. storing the size of
>the memory block along with the location where it is stored.
>
>I might be wrong. Let me know what you have thought.
ANetMemoryTag is an "opaque" type. It's not _always_ a pointer.
To use it, don't use the "*" operator. Use ResolveMemoryTag.
If you look at Memory.c, you'll see the "trick" that I did
to store the size, and why you MUST use ResolveMemoryTag.
Look at Linux/main.c for an example.
>Fine. I had another suggestion: instead of return 1, 2 or 60, it would
>be great if we have an error.h with either #define ERROR_FILE_BUSY 60 or
>a typedef enum { ERROR_FILE_BUSY = 60 } ErrorCode; for the errors.
Go ahead and change Common/Files.h. I'll update the docs. But I prefer that
you use "kANetFileBusy" in the enums to avoid conflics in some operating
systems. And I prefer enums, but don't use typedefs, as I _think_ that this
is not allowed in C.
"ANET_FILE_BUSY": Macro
"kAnetFileBusy" : Constant
Remember: even if I have the "final word" on the code, don't be affraid to
"make up" stuff. The worst thing is that I'll do some clean up, but hey,
that's one of my tasks in ANet anyways.
>| So, this means that instead of using ANSI stuff (FILE *), you can use Linux
>| stuff ("fd": file descriptors, if I'm correct).
>
>'fd' are the usual variable names. The data type is 'int'.
That's what I though. All code I've seen used "fd" for the variable
name, but I had no idea of the type.
An "int"? Simple...
>| what I did. BTW, we should always use "-Wall" with gcc; I saw
>| some weird errors.
>
>Oh! I'll take care.
A good idea is to work from what is in CVS, making the checking easier. You
can checkout anonymously all the stuff from CVS if ssh doesn't work for
you. Just follow the instructions from SourceForge (but don't forget to add
the "-P" flag).
Or, if the only thing you have is HTTP access, you can download the full
CVS archive here:
http://cvs.sourceforge.net/cvstarballs/anet-cvsroot.tar.gz
Dump it somewhere, and change your "CVSROOT" to the dumped directory:
cd ~
# download the .tar.gz in your home directory
tar -zxf anet-cvsroot.tar.gz
#not sure about the following line... do "man cvs"...
setenv CVSROOT ~/anet
mkdir ANet_CVS
cd ANet_CVS
cvs co ANet
>| About symonds.net: Am I dreaming? Wow!
>
>Thanx! :)
Uh... I was talking about the site http://symonds.net/ , not your
homepage... "Wow! That's the _coolest_ home page in the WORLD!"... That
doesn't sound like me... ;-)
I mean, free, banner-free, no strings attached web space?
It's been a while since I've seen that!
- Benad
|