dotgnu-general
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [DotGNU]engins/lib_dir.c


From: Gopal V
Subject: Re: [DotGNU]engins/lib_dir.c
Date: Tue, 15 Oct 2002 20:14:42 +0530
User-agent: Mutt/1.2.5i

If memory serves me right, Charles Shuller wrote:
> ILInt32 _IL_DirMethods_GetFilesInDirectory(ILExecThread *_thread, 
> ILString *path, ILString **files)

I go with what Rhys says ... But remember you need to do recompile
and run your chunk of internal calls ..  ... so the change will be 
effected in mscorlib only when Rhys recompiles it ... Until then 
it's hacks and more hacks... 

> structs would need to be grouped into a list or an array.  Are there any 
> pre-existing functions to create a list/array easily?  
> What about defining a new struct?  

Like what Rhys said ... But IPtoHostEntry would not be a great example
as it returns IPs as ulongs ... 

(System_Array*) ILExecThreadNew(thread,"[oPlatform.FileInfo;","(Ti)V",
        (ILVaInt)numElems);

Would give a nice System_Array ... and ArrayToBuffer on this gives a 
an ILObject** list for you to loop thru and set buf[i]

But remember to keep the same order in both C# and C structs ... 

The ILExecThreadNew allows you to call any constructor if you have the 
signature and type ... For more info on the type ("[oPlatform.FileInfo;")
read the engine/lookup.c for type and signature declarations ....
It is very similar to the JVM sigs (which I was quite familar with)..

Last but not the least , to generate entries for int_proto.h and 
int_table.c (where the internal calls are specified), you can use
the pnet/ilnative/ilinternal tool ... 

ilinternal -p -o int_proto.h mydll.dll
ilinternal -t -o int_table.c mydll.dll

To generate stuff like _IL_DirMethods_GetFilesInDirectory prototypes
and table entries .... (byebye handcoding :-) .. 

And replace the old entries in int_table.c and int_proto.h ... 
(the tables are in sorted order of Class) . But I think you need 
not bother about that if you're editing FileMethods or any other 
classes with existing Icalls...

If everything fails, read engine/HACKING ;-)

Gopal
-- 
The difference between insanity and genius is measured by success


reply via email to

[Prev in Thread] Current Thread [Next in Thread]