There was a need to create userdata from an arbitrary structure, which is defined as

 struct uinput_user_dev { char name[UINPUT_MAX_NAME_SIZE]; struct input_id id; __u32 ff_effects_max; __s32 absmax[ABS_CNT]; __s32 absmin[ABS_CNT]; __s32 absfuzz[ABS_CNT]; __s32 absflat[ABS_CNT]; }; 

(this is the definition from the uinput.h header). However, lua requires a description of the form.

 typedef struct имя { Ρ‚ΠΈΠΏ1 ΠΏΠΎΠ»Π΅1 ... } имя; 

What does duplicate name mean, and how to create userdata from the "normal" structure?

    1 answer 1

    Declare the desired structure as a type as follows:

     typedef struct имя имя;