lua-users home
lua-l archive

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


On Tue, Jun 9, 2015 at 9:45 AM, Javier Guerra Giraldez
<javier@guerrag.com> wrote:
> On Tue, Jun 9, 2015 at 9:25 AM, Segreto, Ingrid
> <Ingrid.Segreto@itron.com> wrote:
>> Is there a way to convert a string into userdata like buf ? Or the userdata type is specific to the application that returns the variable, and by default if lua doesn't know the type of the variable it call it a userdata?
>
>
> the "userdata" name means it's defined by the "user" of the API.  in
> this case, wireshark.
>
> --
> Javier
>

... and so "no" is the answer. It's an opaque blob of data, that has
been adorned only with the capabilities that the API author gave it.

. If the Wireshark API allows you to make a new object/userdata and to
feed the string in as the constructor or some similar magic, then you
can. But userdata is, by design, limited to whatever capabilities the
API author bestowed upon it.

-Andrew