lua-users home
lua-l archive

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


Am 15.04.2015 um 18:40 schröbte Markus Korber:
Hi,

Hi!


[...]

testit = alien.defstruct {
   { "a",     "int"     },
   { "d",     "string" }}

[...]

#define STRING_LENGTH 256
typedef char TString[STRING_LENGTH];

typedef struct TUSB
{
    int a;
    TString d;
} TUSB;


The type "string" in alien is for char pointers (`char*`, 4 byte on 32-bit machines) not for character arrays. I don't think that alien has a type specifier for accessing arrays (it is a rare requirement, because arrays are converted to pointers automatically in most situations).


Philipp