dotgnu-general
[Top][All Lists]
Advanced

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

Re: [DotGNU]lib_dir.c: InvalidPathChars


From: Rhys Weatherley
Subject: Re: [DotGNU]lib_dir.c: InvalidPathChars
Date: Fri, 13 Dec 2002 10:27:53 +1000

"Aditya P. Bansod" wrote:
> 
> > It probably was just an oversight.  Feel free to replace it
> > with an array construction instead, even if it is a zero-length array.
> 
> I must be going stupid, as I can't quite get this to work. Do I have to use
> System_Array and cast it to an ILObject? Or can I create a C array (e.g.
> {'/', '|'} ) and just assign it to the ILObject?
> 
> --Aditya

You'd do something like this:

    System_Array *array;
    ILUInt16 *buf;

    /* Allocate the "invalidPathChars" array */
    array = (System_Array *)ILExecThreadNew(thread, "[c", "(Ti)V",
                                            (ILVaInt)length);
    if(!array)
    {
        /* Bail out if out of memory */
        return;
    }
    info->invalidPathChars = (ILObject *)array.

    /* Fill the "invalidPathChars" array with the invalid characters */
    buf = (ILUInt16 *)(ArrayToBuffer(array));
    /* ... write the 16-bit characters to buf ... */

Where "length" is the number of invalid characters in the array that
you wish to create.

Cheers,

Rhys.


reply via email to

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